Implementing a simple message queue RRS feed

  • Question

  • 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). This is one way recommended in Java JMS specifications.

    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



    Wednesday, June 27, 2012 4:26 PM

All replies

  • A lot of this depends on how you're planning to use this queue - you mention performance - is the queue, its producers, and it's consumers all in one process?  What language/framework are you using?  Do you need the queue to be persistent?

    Reed Copsey, Jr. -
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    Wednesday, June 27, 2012 5:00 PM
  • Thanks for your quick response.

    I want the queue to be persistent and i have already implemented that portions using HSQLDB.Flexibility of changing database/keeping that in memory is also there

    Queue and producer will be different processes, but queue and consumer can be same or different processes(I am giving this flexibility for future use of this queue).I am using .Net4.0.

    I read IBM MQseries help

    It talks about both the patterns i just mentioned in my previous thread.

    Please recommend what would be better in which case. I would be really nice if you could share how famous queues implement this specific area



    • Edited by TicArch Wednesday, June 27, 2012 5:28 PM edit
    Wednesday, June 27, 2012 5:15 PM
  • Can somebody please respond to this.



    Friday, June 29, 2012 11:36 AM