Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Implementing a simple message queue

946216Jun 27 2012 — edited Jul 2 2012
Hi,

My project requires a messgae queue to be implemented which is exposed to outer world for dropping messages.I evaluated various free message queue/message bus options available like MSMQ, ActiveMQ,RabitMQ,ZeroMQ etc but found them either a overkill for my application or lacking the required performance or having a very high learning curve.

So I am building my own message queue. The last area which is to be architected is queue pop area. I need to know as which one of these two is the best optimised way of taking out message from queue:-

1) The consumers should register themselves with queue by imlementing a callback.When any message comes in queue, queue will invoke there specific method along with message.(This will take out processing thing from consumer from consumer but puts the burden on queue as queue has to wait until consumer uses the message and thread of queue becomes free for sending next message). I think, this is one way recommended in Java JMS specifications, though i am not sure.

2) The consumers should register themselves with queue by imlementing a callback.When any message comes in queue, queue will just intimate the consumer with no thread blocking on the queue side. It is consumers duty to then take out the message from queue.

I am not sure which one is best optimised and industry wide implemented in various commmercial/open source offerings.

Please suggest

Cheers

TicArch

Comments

Very good tutorial and explained to the point.. Great and useful quick reference..

veera2

Thanks for the nice article.  could  you pls explain  what is client and server in this context.

-Veera

Thamizharasu

Thanks for the nice article.  could  you pls explain  what is client and server in this context.

-Veera

Hi Veera2,

Thanks for your question. Client means the client code which will talk to the REST API. Server means the REST API which will produce result for the consumer.

I hope this will clarify your question.

Thanks,

Tham

Ajit Kumar Singh

Thanks for the nice article.

user8193082

nice!!, thanks

User_GIRQ8

Nice article. Could you please explain, how can we limit the number of requests originating from a same IP i.e "Rate Limiting" through Jersey to avoid flooding?@

1 - 6
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Jul 30 2012
Added on Jun 27 2012
4 comments
2,509 views