【消息中间件Kestrel】

Kestrel是twitter的开发团队用scala语言写的开源消息中间件。

Kestrel is a simple, distributed message queue written on the JVM, based on Blaine Cook's "starling".  

Each server handles a set of reliable, ordered message queues, with no cross communication, resulting in a cluster of k-ordered ("loosely ordered") queues. Kestrel is fast, small, and reliable.

Kestrel is:  

1)fast  

It runs on the JVM so it can take advantage of the hard work people have put into java performance.  

  

2)small  

Currently about 2500 lines of scala, because it relies on Netty (a rough equivalent of Danger's ziggurat or Ruby's EventMachine) -- and because Scala is extremely expressive.  

  

3)durable  

Queues are stored in memory for speed, but logged into a journal on disk so that servers can be shutdown or moved without losing any data.  

  

4)reliable  

A client can ask to "tentatively" fetch an item from a queue, and if that client disconnects from kestrel before confirming ownership of the item, the item is handed to another client. In this way, crashing clients don't cause lost messages.  

具备了以下特点:

  快速:Kestrel运行在JVM上,用户可以视为java的项目来使用高级的优化手段。

  小巧:Kestrel大约2500行scala代码

  持久性:为了获取不错的性能表现,队列是存储在内存中。但是同时在硬盘上保留了日志,因此服务器 关闭可以保证不丢失数据。

  可靠性:客户端可以尝试获取队列中的数据项,如果客户端在没有确认获取数据项之前断开链接,数据 项还可以被其他客户端获取,就是说客户端崩溃不会导致数据项的丢失。

支持多请求协议:目前支持三种协议,

memcache协议(并没有完整的实现memcache协议,只支持部分操作协议),

text协议,

thrift协议

Kestrel is not:

strongly ordered

While each queue is strongly ordered on each machine, a cluster will appear "loosely ordered" because clients pick a machine at random for each operation. The end result should be "mostly fair".

transactional

This is not a database. Item ownership is transferred with acknowledgement, but kestrel does not support grouping multiple operations into an atomic unit.

猜你喜欢

转载自gaojingsong.iteye.com/blog/2422095