IBM Integration Community Come for answers. Stay for best practices. All we’re missing is you. Join / Log in Ask a question
Team,with java code, we are reading Queue messages, and also reading with filter.We are using the below function to read queue messages with a filter. this function supports only 6 fields but Queue has more than 25 fields 1) gmo.matchOptions = MQConstants.MQMO_MATCH_MSG_SEQ_NUMBER;2) gmo.matchOptions = MQConstants.MQMO_MATCH_GROUP_ID;3) gmo.matchOptions = MQConstants.MQMO_MATCH_CORREL_ID; 4) gmo.matchOptions = MQConstants.MQMO_MATCH_MSG_ID; 5) gmo.matchOptions = MQConstants.MQMO_MATCH_MSG_TOKEN; 6) gmo.matchOptions = MQConstants.MQMO_MATCH_OFFSET;We want to filter data with all the fields. Can you please support the filter for all the fields ?we are using the below IBM MQ Jars com.ibm.mqcom.ibm.mq.jmqicom.ibm.mq.pcf
please let us know If any other method available which supports all the fields.
The fields you show us that can be matched on are not queue attributes, but message attributes.
You can use an SQL selector string to match on any field in the MQMD. Some example selector strings are shown in this post. You can use the selector string using the JMS API thus:-
// Create consumer with selector
String selector = "Root.MQMD.MsgType = 4";
MessageConsumer cons = session.createConsumer(queDest, selector);
Can you please let us know how to pass the Message Consumer variable to get function?following is our code and which jar do we need to use ? Is it javax.jms.jar?
// Create consumer with selector String selector = "Root.MQMD.MsgType = 4"; MessageConsumer cons = session.createConsumer(queDest, selector);
Using com.ibm.mqjms TPL I tried to implement filter, am able to filter messages based on the below properties But I want to filter messages based on Message Data EX: we have message data, 1) Manager 2) Employee 3) Lead 4) Manager I want to read messages where message data equal to Manager