@MessageDriven - possible to subscribe to multiple Queues / Topics?

Hi there,
I got a rather basic question which I couldn't google.
Is it possible for ONE Message Driven Bean in EJB3 to subscribe to more than one Queue or Topic (multiple subscriptions).
If so, how?
I appreciate your help!

Thank you for pointing that out, even though I was hoping for another answer.
I think there may be a couple of cases where it would make sense that one MDB subscribes to multiple topics.
Anyway, I guess I'll just implement the functionality in another session bean and use the MDS's as a sort of a relay.
Thanks again!

Similar Messages

  • Multiple Apps and Multiple Queues/Topics

              In WL7, is it possible to have two applications both do the same JNDI lookup and get
              different queues? This is possible with EJB's because Weblogic has its own local
              JNDI lookup that the java:comp/env/ejb/XXX references, however you cannot do the
              local lookup with JMS queues/topics. My situation is that I may have more than one
              client on a given box, and the messages going into a queue are destined for specific
              clients, but the programs are both looking up the same queue (e.g., jms/UpdateCache).
              Is the only way to do this through using filters? I don't want to make any code changes
              from one client app to the next.
              

    You can configure same queue/topic on multiple servers by using
              JNDINameReplicated=false on the queue/topic so each queue/topic is only
              known locally. Then you can use dedicated connection Factory for each
              server and you can use different url to connect to different server.
              e.g.
              # two connection factories deployed on two different WLS servers
              # myserver1 has url like this: 192.0.0.1:7001
              # myserver2 has url like this: 192.0.0.2:7001
              # two JMS Servers deployed on two different WLS servers
              # each JMS server has an identical queue
              # you do not need to specify JNDIName for the queue if you can use
              createQueue
              # queueSession.createQueue("./exampleQueue1");
              # client (sender/consumer) using 192.0.0.1:7001 to get initialContext
              will use "cf1" and
              # lookup queue on myserver1
              # client (sender/consumer) using 192.0.0.2:7002 to get initialContext
              will use "cf2" and
              # lookup queue on myserver2
              # port of config.xml
              <JMSConnectionFactory
              JNDIName="jms.connection.exampleFactoryFormyServer1"
              Name="cf1" Targets="myserver1"/>
              <JMSConnectionFactory
              JNDIName="jms.connection.exampleFactoryFormyServer2"
              Name="cf2" Targets="myserver2"/>
              <JMSServer Name="exampleJMSServer1" Targets="myserver1">
              <JMSQueue
              JNDIName="jms.queue.exampleQueue1"
              JNDINameReplicated="false"
              Name="exampleQueue1"/>
              </JMSServer>
              <JMSServer Name="exampleJMSServer2" Targets="myserver2">
              <JMSQueue
              JNDIName="jms.queue.exampleQueue1"
              JNDINameReplicated="false"
              Name="exampleQueue1"/>
              </JMSServer>
              "David Cherryhomes" <[email protected]> wrote in message
              news:[email protected]...
              >
              > In WL7, is it possible to have two applications both do the same JNDI
              lookup and get
              > different queues? This is possible with EJB's because Weblogic has its own
              local
              > JNDI lookup that the java:comp/env/ejb/XXX references, however you cannot
              do the
              > local lookup with JMS queues/topics. My situation is that I may have more
              than one
              > client on a given box, and the messages going into a queue are destined
              for specific
              > clients, but the programs are both looking up the same queue (e.g.,
              jms/UpdateCache).
              > Is the only way to do this through using filters? I don't want to make any
              code changes
              > from one client app to the next.
              

  • 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

  • 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

  • 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

  • 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
              

  • 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).

  • Single Queue Vs Multiple Queues

    Hi,
    I am in the process of architecting some queues between remote databases. There are different document types being propagated from one queue to another, and they have different priorities. At the end queue there are multiple processes to dequeue and action the different document types.
    My question is, is it better to have one end queue for each process/document type ( ie multiple end point queues), or one single end point queue with all the documents in them regardless of the type?
    I know that it is possible to have the single queue end point, but is this the best option and why?
    Thanks,
    matt

    Hi Peter,
    What do you mean by different document type?Document content only is different. The payload will be the same. All the documents will be passed through as blobs. The payload will have a field to define the document content type.
    Do you intend to store different message types in the same source queue?At this stage we can go either way. If we have one single end point queue we will more than likely have one single source queue.
    If so what is the definition of the payload? The payload definition will be the same in all cases, both source and destination.
    What version of databases are you propagating between?10.2
    How many dequeueing processes will you have at the remote end?One program for each of the different document content type (invoices, remittance, etc.). Initially there will be 4, but this is likely to grow to 12 or more.
    Ultimately we expect around 10,000 documents per day to pass through the system.
    Thanks,
    Matt

  • 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".

  • One queue or multiple queues?

              Hi all,
              I have a JMS-based app that performs a few business functions, and each business
              function is handled by a single MDB. These MDBs see moderate traffic volumes
              (<5000 msg/day), and my question is this:
              Is it better to leave this design as-is, or is it better to merge these MDBs
              and their
              corresponding queues and use JMS selector to decide what biz function to perform?
              -j
              

    Performance-wise it is better to use multiple queues, but
              your message rate is likely too low for this to make
              a difference.
              There is another advantage to using multiple queues:
              they make it easier for system administrators to
              see the statistics for different business processes, and
              possible to manage each differently.
              John wrote:
              > Hi all,
              >
              > I have a JMS-based app that performs a few business functions, and each business
              > function is handled by a single MDB. These MDBs see moderate traffic volumes
              > (<5000 msg/day), and my question is this:
              >
              > Is it better to leave this design as-is, or is it better to merge these MDBs
              > and their
              > corresponding queues and use JMS selector to decide what biz function to perform?
              >
              > -j
              

  • Web service which listens/replies over JMS Queues/Topics - HOW?

    Hi all,
    I need help - I have to implement the following Web Service for Weblogic 8.1:
    - Simple Helloworld operation
    - The Web service should listen on a Queue(or Topic) - say Queue1
    - The response of the service should be put in another queue - predefined - say Queue2(or taken as propetry of the request "ReplyTO")
    I looked for such an implementation in the available examples and forum topics, but without luck.
    Please, give an example or a guide how to implement such a service if possible!
    Thanks,
    Ivo

    Hi,
    I have a work around to this problem please see if it suits you or you might already be knowing it.
    Workaround is
    1. Create a Simple Webservice as needed which puts a message in a Queue.
    2. Create an MDB which listens to you Queue / Topic and call the created webserivce in the onMessage function of the MDB.
    Vivek

  • Cleanup JMS queue/topic messages

              how do I clean up all messages left on a queue/topic ? thx.
              

    There is no purge command.
              In 8.1, delete and recreate the destination via the console,
              JMX, or extensions.JMSHelper, the JMS
              server doesn't even need to be booted. A timestamp
              in the destination configuration is automatically set to
              let JMS detect that the destination is a new version.
              In 7.0, delete the queue, shutdown the JMS server,
              reboot the JMS server, and then recreate the destination.
              In any version, shutting down the JMS server will delete
              non-persistent messages.
              You can delete topic subscriptions via the console.
              You can write a simple JMS client to drain the destination
              by consuming messages. (Multi-thread multiple consumers to
              speed this up considerably.)
              Queen Tsao wrote:
              > how do I clean up all messages left on a queue/topic ? thx.
              

  • Listening to multiple queues

    Hi all,
    Can a MDB listen to multiple queues. If so how will be the deployment descriptor
    Thanks
    Hashin

    No.
              _sjz.
              "Jim" <[email protected]> wrote in message news:3d496d70$[email protected]..
              >
              > Is it possible to configure an MDB to listen to more than one Queue ?
              

  • 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

  • Is it possible to set up multiple iTunes accounts on a single computer?

    is it possible to set up multiple iTunes accounts on a single computer?

    If you do it with a single user account, you will receive update notifications for purchase made on both IDs regardless of which one you're using at the time.  That's slightly frustrating as you get the notification BUT you can't actually update!  In any event, separate user accounts on the computer is the cleaner way to go.

Maybe you are looking for