Behaviour of multiple queue receivers on same queue

I have been trying to find out what exactly the jms specification states about having multiple queue receivers registered on the same queue. Some books and people say that one is only supposed to register one queue receiver per queue, if this is the case then one might as well use one topic subscriber per topic (what is the utiliy of a queue then).
I believe that one is allowed to register multiple queue receivers on a queue, and a message will only be consumed by exactly one and only one queue receiver, thus allowing for true parallel processing. This is the behaviour I have observed when using jms on both JBoss and Weblogic (and apparantly is the same on Websphere).
I have looked at the formal JMS spec from sun and they dont make it clear what the behaviour of multiple queue receivers on queue is. Can somebody PLEASE help me clear this up.

The behaviour is undefined by the spec. Here is what it says:
"Although it is possible to have two sessions with a QueueReceiver for the same queue, JMS does not define how messages are distributed between the QueueReceivers."
However, multiple receivers on a single queue is a very popular design pattern. A typically pattern is to use the queue as a worklist and for work items to be posted to the queue. There is then a collection of workers who are registered as queue receivers picking out their work items from the queue. These workers are processing in parallel and as the workload increases you respond by add more workers.
This pattern is usable where message ordering is not important and that the workers are stateless.
Steve

Similar Messages

  • Multiple queue receivers with disjoint message selectors - portable?

    Hi all,
    I was wondering whether an application that uses multiple queue receivers with disjoint message selectors would be portable across different JMS providers.
    I fear it's not - at least the spec clearly states that the implementation of message delivery to multiple receivers is provider specific, and I couldn't find any comment that this would be different with disjoint selectors. But I wanted to check with you - maybe I missed anything?
    What could be an alternative then (in case you want to avoid multiple queues)? Using a topic with durable subscribers?
    Regards,
    Sabine

    Hi Nimo,
    accepted - as long as the JMS spec requires the JMS provider to support multiple receivers. And that's exactly the point where I'm not sure...
    Literally it states:
    "For PTP, JMS does not specify the semantics of concurrent QueueReceivers for the same queue; however, JMS does not prohibit a provider from supporting this."
    The formulation "does not prohibit" makes me think that JMS allows providers also not to support this, for example, to throw an exception when a second consumer is created for the same queue, or not to serve it at all with messages as long as the first consumer is active. Not that I think it would be a very useful implementation - I just want to know if it would be possible. In that case, the application would not be portable.
    Regards,
    Sabine

  • Multiple consumers of the same Queue

    In the past my use of JMS queues has been limited to a single message producer and a single consumer. I am now looking at having multiple copies of the same consumer running for load balancing and failover purposes, and this leads me to what I think is a basic question. BTW, we're running OpenMQ 4.4u1.
    I have messages being produced and saved in a single queue.
    I then have a consumer program whose logic is something like this:
    1. Create session with no transaction and CLIENT_ACKNOWLEDGE.
    2. Receive message from queue.
    3. Do some processing with message. Repeat processing attempts multiple times, if needed, until successful.
    4. Once processing is successful, acknowledge message.
    Assume that I am running multiple copies of the consumer in separate JVMs (or on separate servers, for that matter).
    Here are my related questions.
    1. If step 3 takes a long time (e.g., several minutes) can I be sure that only one instance of the consumer will receive the message?
    2. If a consumer is in step 3 and a catastrophic failure occurs (e.g., the JVM or server it is running on crashes) the message will never be acknowledged, but the session will not be shut down in an orderly fashion, either. Will the message that was received but never acknowledged eventually be delivered to another copy of the consumer?
    3. If step three takes a very long time (hours or days, rather than minutes), will the broker misinterpret this as a failure of the consumer and deliver the same message to another one of the consumers?
    Thank you for reading and/or responding to this question.
    Bill

    1. If step 3 takes a long time (e.g., several minutes) can I be sure that only one instance of the consumer will receive the message?A queue message will only be delivered and consumed by 1 consumer.
    2. If a consumer is in step 3 and a catastrophic failure occurs (e.g., the JVM or server it is running on crashes) the message will never be acknowledged, but the session will not be shut down in an orderly fashion, either. Will the message that was received but never acknowledged eventually be delivered to another copy of the consumer?Yes.
    3. If step three takes a very long time (hours or days, rather than minutes), will the broker misinterpret this as a failure of the consumer and deliver the same message to another one of the consumers?No, as long as the consumer's Session or Connection are intact

  • How do I use same MDB for multiple Queues? Deployment ?

              Here is what I am trying to do
              I have written one MDB that I want to use for multiple queues. I have seen posting
              mentioning that code a new weblogic-ejb-jar.xml to define other queues as the
              solution.
              Is there any other work around?
              I want to add queues in future as and when needed. I don't want to modify the
              already deployed jar to replace it with new weblogic-ejb-jar.xml everytime I have
              to add another queue for the message-driven-bean. Is is possible to use some kind
              of reference tag and just put weblogic-ejb-jar.xml in a new jar file and deply
              that every time I have a new queue to use for this MDB ( I don't think so, but
              again ???).
              Any help would be greatly appreciated.
              Chris
              

    Sorry -- that's the only solution for now.
              greg
              "Chris" <[email protected]> wrote in message
              news:[email protected]..
              >
              > Here is what I am trying to do
              >
              > I have written one MDB that I want to use for multiple queues. I have seen
              posting
              > mentioning that code a new weblogic-ejb-jar.xml to define other queues as
              the
              > solution.
              >
              > Is there any other work around?
              >
              > I want to add queues in future as and when needed. I don't want to modify
              the
              > already deployed jar to replace it with new weblogic-ejb-jar.xml everytime
              I have
              > to add another queue for the message-driven-bean. Is is possible to use
              some kind
              > of reference tag and just put weblogic-ejb-jar.xml in a new jar file and
              deply
              > that every time I have a new queue to use for this MDB ( I don't think so,
              but
              > again ???).
              >
              > Any help would be greatly appreciated.
              >
              > Chris
              

  • Http to Abap Proxy communication with multiple queues generation in Recevr

    Dear SDNs,
    I need some help in the following scenario, appreciate your suggestions and help .
    I am receiving the messages from sender to PI on http posting, from PI  I am sending the message to SAP system using receiver xi communication channel ( receiver is abap proxy).
    Sender will send the messages in QOS=EOIO, QUEueID=XXXt_100 etc  parameters, when large volumes cases, it is getting delayed to process it using a single queue.
    We are thinking to dynamically  generate multiple queues in PI and send the same queue ids to receiver SAP system to process all the messages quickly in SAP System also.
    Help /Clarifications needed:
    1. XI receiver communication channel in  pi  does not provide any options to generate dynamic queue id based on payload content (using dynamic configuration) and sent it to SAP.
    2. Module Tab in receiver communication channel also got disabled to add  custom adapter modules, can we add custome adapter module on xi receiver channel to generate dynamic queue id ?
    Really appreciate your immediate help and suggestions.
    Thanks.
    Suraj.

    Dear Praveen,
    Thanks lot for the immediate reply, we need to use EOIO, as the messages need to be processed in the same order we send and receive, there is no flexibility in QOS=EOIO, Appreciate if there is any other thoughts?
    Thanks In Advance.
    Suraj.

  • Multiple queue vs single queue - peformance

    Hi All,
    Could pls throw some light on the following design.
    Currenty, We have more than 100 queues and for each there is a different MDB to receive the message.Now, somehow we made a single instance of same MDB listen to all these queues by looking at the input message. The requiement now is, is it possible to club all the queues into single queue as it's asynchronous messaging. The receiver may also try write into the same queue at the end of message processing.If so, how would be performance. Is this performance better than having multiple queues?.
    The message are expecting to be 25 k/day in the queue. And we are using Weblogic server.
    Please let me know if you need more details.
    Thanks
    Srinath

    You could try to use selectors to assign messages to particular MDBs. This way you off load some of the work on the broker but selectors by their nature usually have an impact on broker's performance. It all depends on your application, your expectations, size and the rate of your messages, how long it takes to process them on the client side. There is no simple answer in this case. You would have to test some scenarios to come up with a best solution that fits your requirements. Having said that I personally believe that some degree of partitioning of your queue could be beneficial. On a heavily loaded system it may increase the concurrency of the system and its resilience, particularly if you place the queues in different brokers. Try to imagine your broker as if it was a DB server with just one table (I'm not sure if this is the best analogy but I can't think about anything else at the moment).

  • Multiple Queues in BPM

    Hey,
        In case of multiple queues in BPM.
        say for instance multiple queues(random)      
        When we check in SXI_MONITOR, in the QueueID column we get :
              XBPE_TaskId_No_QueueId.
    Please can you tell me what is the significance of  "No" in the above QueueId
    normally its 1 or 2.
        can you also tell me how it affects the queue behavior.
    regards,
           Milan

    Prateek that is what i have done.
    two files are picked from the file adapter they are merged and placed back on the ftp.
    Now this scenario was working as expected when the no was 1. (i.e it went into sysfail, when both the files of the same instance entered different queues)
    but in subsequent runs, when no was 2,  it started working as i have explained. (i.e. it worked absolutely fine without getting into sysfail)
    I have not done any changes in the configuration it happened automatically.
    so i am not able to understand the phenomena.
    regards,
        Milan

  • Multiple Queues(Content Specific) - Can't get more than two queues

    Hi,
    I have a ccBPM scenario, which collects messages read by the file adapter and then sends them grouped.
    It's working fine in many different configurations, but I'd like to configure it in a way described in the PDF "How Tou2026 Configure Inbound Processing in ccBPM Part II: Queue Assignment", which is using Multiple queues - content specific.
    If I put 2 queues (after defining a correlation for a message field batchID), it works fine. The messages with batchID=A are processed by one instance process from queue 001, and the messages with batchID=B are processed by another instance process from queue 002.
    But if I put 4 queues (SWF_INB_CONF), all the message still keep going to just 2 queues, and not 4. There is no problem, because still the messages with batchID = X are all processed by the same instance process, but I want to add more parallelization to the process using 4 queues.
    I've refreshed cache and reactivated, but it will still work with 2 queues and not 4. I've also made sure that the files read have 4 different batchIDs equally distributed among all the files.
    I don't know what I'm missing...
    Thanks!

    Solved it with SAP help.
    It seems that even if you config 4 queues (content-specific) to be used in SWF_INB_CONF, it is normal that not all queues allowed are used at runtime. The messages are distributed to the queues based on the correlation defined for the process, narrowing down the result afterwards to the number of allowed queues using a hash algorithm.
    Often it is necessary to specify 50-100% more queues to load the actually intended number of queues with messages.
    I could reach 4 queues really used setting the parameter to 10 queues.

  • Support package upgrade / SPAU with multiple queues

    Hello,  We are upgrading our support package level on our ECC 6.0 system.  I divided up the support packages into 4 different queues:
    SAP_BASIS
    SAP_ABA
    PI_BASIS
    ST-PI
    SAP_BW
    SAP_AP
    SAP-HR
    After importing each queue, I had a few things to do in SPDD and SPAU.  I created a new SPDD or SPAU transport request for each queue.  My question is now what is the recommended procedure to handle these SPAU/SPDD transport requests when you have multiple queues?  I plan to define the same queues when doing QA and PRD.  Do I mark all of the requests and then when I do each queue, I only specify that particular request?  Thank you in advance for your help.
    Best regards,
    Russ Cook

    Hi Russ,
    when did you export the different SPAU requests or didn't you export them at all?
    If the export happens only after all queues are already imported, this final system state (component version + SP level) is stored in the requests.You are then not able to include e.g. the request for the SAP_BASIS SPs into the SAP_BASIS queue, because the other components are still on the old version, while according to the request they should be on the newer state.
    So, the right procedure would be; import the SP queue, do the modification adjustment for this queue, mark the workbench request as modification adjustment transport request and export this request. Then you can import the next SP queue.
    Best regards,
      Dirk

  • Disadvantage of using multiple queues?

    is there a way to allow only a specific client to retrieve a specific message using a single queue? i would like to have multiple clients sending and recieving messages to a queue but they may not be sending them and retrieving them in any specific order. i want to have it so when a message gets sent, only a specific client will be able to receive that message. so if i have several clients waiting to recieve messages from the queue, the client that the message is for will be the only one to get the message. is there a way to set an ID number or something on the messages designating which client should read them? or is it better to use multiple queues where each client will have its own specific queue that it will be reading from? is there any performance disadvantages to creating multiple queues?

    Hi,
    Your receivers can use a message selector based on a JMS property that is set accordingly by your senders. Regarding performances it is mainly dependent on the number of consumer types you want to use and of the number of destination that are already deployed on your JMS server. A consumer that uses message selector is slower than a standard consumer then it is better to use multiple destinations. However, the JMS server may be overloaded if too many destinations are deployed. You should do some tuning of your JMS server to find out the best suitable solution for your needs.
    Arnaud
    http://arjuna.com

  • Multiple Queue Assignment for Integration Process - PI 7.11

    Hi,
    I am trying to configure multiple Queues for an Integration Process.
    The Integration Process is straight forward, except for a Asynchronous Request Response pattern with correlation. (A asynch send step - immediately followed by a asynchronous receive step with Correlation)
    I have done the following
    1) In IR set the Queue as Multiple - Content Specific
    2) In SWF_INB_CONF transaction reconfigured Multiple Queues - Content Specific without buffering
    But when I trigger the message, the message is not at all triggering/entering the Integration Process. The error message is BPE Internal Failure.
    But if I reconfigure the IP as One Configurable Queue & "Without Buffering", it is working. But we want multiple queues assigned to this Process.
    Thanks in advance.
    Regards,
    Sudharshan N A

    Bjoern, there are blogs/wikis available which should be searched before a question is asked on forum. The information you need is quite basic one and I will therefore lock this thread.
    Regards,
    Prateek

  • How to implement multiple queues in one circular buffer?

    Spoiler (Highlight to read)
    Recently I have successfully shared data of 2D array among different vis in a project, using circular buffer.
    However, there is only one circular buffer allowed in one project for one data type.
    I want different vis, running and getting data from circular buffer in different speed, all getting data as a queue from circular buffer. Like the circular buffer's read continuous mode.
    The problem is that after a vi reads in continuous mode, the read data is deleted from the circular buffer. Then other vis can not use them any more and can not keep track where they should begin to read again.
    So if it is possible that there are multiple pointers or queues in circular buffer to keep track the progress of different vis, and data only update when it gets input from DAQ but not deleted when read?   

    LawrenceChong wrote:
    Spoiler (Highlight to read)
    Recently I have successfully shared data of 2D array among different vis in a project, using circular buffer.
    However, there is only one circular buffer allowed in one project for one data type.
    I want different vis, running and getting data from circular buffer in different speed, all getting data as a queue from circular buffer. Like the circular buffer's read continuous mode.
    The problem is that after a vi reads in continuous mode, the read data is deleted from the circular buffer. Then other vis can not use them any more and can not keep track where they should begin to read again.
    So if it is possible that there are multiple pointers or queues in circular buffer to keep track the progress of different vis, and data only update when it gets input from DAQ but not deleted when read?   
    THe last time I wrote a multi-subscriber cirular buffer was in LV 6. Since then I have found that polymorphic queues perform much better so I now use multiple queues. One queue for each subscriber of the data. The subscribers are then responsible for maintaining their own histories.
    So just use multiple queues.
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • How can a JMS adapter be configured in BPEL to consume messages from multiple queues ?

    How can a JMS adapter be configured in BPEL to consume messages from multiple queues ?

    If you want to use JMS with AQ as datastore then there is some configuration you need to do to enable this. This is outside SOA Suite per sa, e.g. no adapter required.
    If you want to connect to the AQ direct then use the AQ adapter.
    this blog may be of some help understand the configuration
    http://biemond.blogspot.com/2008/01/oracle-jms-with-esb-and-bpel.html
    cheers
    James

  • Multiple Queues - Dequeueing resources?

    We have multiple queues on our database which have been configured to be automatically processed by registering stored procedures with each of the queues. The processing of messages works fine, however if we have messages in both queues then it appears as though an attempt is made to process all messages in one queue before it processes messages in the other queue. Are there any settings that we can look at setting to distribute the processing equally between queues?

    Other than job_queue_processes, I don't know.
    Have you made any progress with this?

  • Queue Scaling by Multiple Queues

    Hi,
    I see that there is an option to "Scale" Instances in Azure Management portal.
    My question is pertaining to scaling based on "Queue"?
    I have a Cloud Service and I want to increase instances based on MULTIPLE QUEUES. Is it possible?
    Currently, it allows to scale by only one queue.
    Apppreciate any help on the matter.
    Viral.

    I'm sorry but it's possibile to configure the service to scale by only one queue.
    Davide 'n3wt0n' Benvegnù
    If you found my answer helpful, please vote it.
    If you think that my answer resolve your issue, plase "Mark it as answer".

Maybe you are looking for

  • Modify field in ALV

    Hello to all. Anyone know how to print only a few char of a field in ALV? The outputlen defines the number of characters, but there's a way to tell it to print from the second or third position?

  • *** es:preparedStatement TAG replacement in 3.5 ***????

    hi there. does anybody know what is the replacement for the tag <es:preparedStatement> in WLCS 3.5? nobody seems to be facing this problem. any help is appreciated. thanks, nadeem

  • How to read a source file?

    Hi Everyone, I have to write a script that read a souce file, each line is a record with 5 fields with a comma-delimited and insert these records to a table. The file is in a local folder. I have no idea how to do this yet. A friend of mine suggested

  • Move backed up music into new itunes

    I backed up my itunes to an external hard drive when computer crashed, but cant figure out how to move into itunes all at once.  I can only do it one by one.

  • Table Name-Changes in SO

    Dear All, As we all know that any changes done in Sales order, we can see them by going to Va02-->Environment -->Changes... According to our client's requirement, we need to generate a report which can show all the changes done to a SO. For this I wa