jms - how to read only specific queue messages based on message header property -
i have list of messages in activemq queue. each message has custom header property value. how should able access messages custom header property value = 123.?
i using below pick message queue. how pick messages or single message has customheaderproperty =123.?
consumertemplate consumertemplate = camelcontext.createconsumertemplate(); exchange ex = consumertemplate.receive("activemq:queuename",10000); string data = ex.getin().getbody(string.class); string number = ex.getin().getheader("customproperty", string.class);
use message selectors on consumer. selector sql query. write mycustomheader = 123
. here pretty cheat sheet.
since tagged question apache-camel, guess working camel setup. in case, need supply selector camel. from("activemq:queue:myqueue?selector=mycustomheader%3d123").
.
Comments
Post a Comment