JMS Queues or Topics?

Discussions

General J2EE: JMS Queues or Topics?

  1. JMS Queues or Topics? (3 messages)

    I'm just starting to read and learn the JMS API. I haven't done any programming with this API yet, so this question is probably naive.

    What prevents a consumer from using a Topic Connection to read messages put by a provider in a Queue or vice versa? Is it even possible?

    Threaded Messages (3)

  2. JMS Queues or Topics?[ Go to top ]

    This is just not possible using JMS directly.

    Remember that a Queue or a Topic is merely a destination. If you put information into a destination, it can only be read from the same destination.
  3. JMS Queues or Topics?[ Go to top ]

    This is just not possible using JMS directly.

    >
    > Remember that a Queue or a Topic is merely a destination. If you put >information into a destination, it can only be read from the same destination.

    This is what I probably am not clear about. Supposing a message is put on a Topic named topic-one, Why can't a consumer create a Queue to listen on topic-one?
  4. RE:JMS Queues or Topics?[ Go to top ]

    Robert Koomr
    This is what I probably am not clear about. Supposing a message is put on a Topic named topic-one, Why can't a consumer create a Queue to listen on topic-one?

    Well, it seems that you have great misunderstanding about how the JMS works. In general, there are 3 parties involved:
    1. Producer -- one who produces message, i.e. send them to destination.
    2. Destination or channel or name it as you wish.
    3. Consumer of messages that is notified about message availability and retrieves them.

    What you are asking for is to make one destination a producer and second destination a consumer.

    Firstly it sounded like nonsense to me. Destination may not play either consumer or producer roles. However, it very similar to well-known message forwarding idiom. What you need is message forwarder -- a component that will play both roles. This component will be a listener (consumer role) on a topic and forward certain/all messages to queue (producer role).

    Do you need actually this? Anything above is only my guesswork, of course :-) Anyway, I believe this would be a useful site for you: http://www.enterpriseintegrationpatterns.com/

    VS