• Post Reply Bookmark Topic Watch Topic
  • New Topic

Reading group messages in mdb

 
rakesh keskar
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
is it possible to read the multiple messages together in MDB ( like all the order messages belonging to one customer )
 
ramprasad madathil
Ranch Hand
Posts: 489
Eclipse IDE Java Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set a header in the message before you send it and when you create a receiver, create one using the overloaded api that specifies a selector expression.

In the msg producer

msg.setStringProperty("someName", "someValue);

and in the receiver (assuming a queue)

queueSession.createReceiver(queueObj, "someName=someValue");

That's just a sample to get you going in the right direction. Google for jms message selctors and there are very good tutorials out there that explains it fully.

ram.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!