JMS - Going from one to multiple consumers

前端 未结 2 2000
既然无缘
既然无缘 2020-12-12 16:29

I have a JMS client which is producing messages and sending over a JMS queue to its unique consumer.

What I want is more than one consumer getting those messages. Th

2条回答
  •  醉梦人生
    2020-12-12 17:22

    You may not have to modify the code; it depends on how you wrote it.

    For example, if your code sends messages using MessageProducer rather than QueueSender, then it will work for topics as well as queues. Similarly if you used MessageConsumer rather than QueueReceiver.

    Essentially, it is good practice in JMS applications to use non-specific interfaces to interact with the JMS system, such as MessageProducer, MessageConsumer, Destination, etc. If that's the case, it's a "mere" matter of configuration.

提交回复
热议问题