2

Can anyone guide me how to use routing key to send/receive message on queue using jmsclient.js. Reference taken from https://demo.kaazing.com/demo/jms/javascript/jms-javascript.html. As of now, i have to create multiple queues with distinct names for the number of consumers listening. I want to have only one queue but with different routing key specified for each consumer.

NewBee
  • 195
  • 8

1 Answers1

0

You can set a property with some unique key for each consumer. Then when you consume messages, use a selector. The link you refer to have already an example selector, `symbol=KZNG', but you could use whatever key/value that suits your need.

Something like receiver=CentralAvenueOffice or receiver=theOldFishFactory

Petter Nordlander
  • 22,053
  • 5
  • 50
  • 84
  • Thanks Peter, i tried the same demo with 3 instances opened in browser and subscribed to same topic as 'topic/destination' but message selector as symbol='2010'~symbol='2012' respectively. So, i assume when i will send message to topic 'topic/destination' with message selector as symbol='2010', than only consumer subscribed to that topi/queue with that message selector should receive the message. But, not subscriber receives the message. Please correct if my assumption is wrong. – NewBee Aug 19 '14 at 08:33