views:

81

answers:

1

I'm going to develop my own message queue implementation in Java and I need to distribute the queue content across multiple servers so that it would provide reliability and redundancy.

In addition to that I need to persist the queue content into the file system.

Can somebody tell me what is the most suitable distributed data structure implementation to hold my queue content?

Note: That data structure must provide me the message ordering facility. That means I need to receive messages according to the order they arrived. Also while reading a message, it should be in a 'locked' state so that other consumers cant read it until the first consumer completes the reading process

+4  A: 

Have you looked at any of the many existing message queue implementations for java? Wikipedia lists many open source implementations. It seems to me that an existing, thoroughly tested message queue is the best place to hold your queue content :)

If you absolutely want to write your own, then starting with the open source solution that most fits your needs would probably answer most of your questions about what data structures work well.

Peter Recore
Thanks Peter,I went through several message queue implementations and I was looking for the reliable messaging and durable subscription features. It seems most of them are using file based persistence for message and broker state storage.But here I'm planning to use distributed storage for MQ back end and I want to make it 'pluggable' with many distributed storage types. In addition to that I need to provide support for rich set of transport protocols(such as REST, XMPP) for this queue as well. Those feature are hard to implement, but at least I need to give it a try.Thanks
Dunith Dhanushka
ActiveMQ supports pluggable storage backends and transport mechanisms (including REST and XMPP). This would give you the flexibility to implement your own storage and transport it none of the provided implementations suit without having to write the complete message queue implementation.
Mark
@Dunith Dhanushka What do you mean by "distributed storage?" ActiveMQ allows you to store your data in a variety of ways, and also supports clustering options like master/slave replication.
Peter Recore