ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS MessageSelector issue while querying

Post new topic  Reply to topic
 JMS MessageSelector issue while querying « View previous topic :: View next topic » 
Author Message
Sandeep_Sundaram
PostPosted: Wed Apr 13, 2016 6:35 am    Post subject: JMS MessageSelector issue while querying Reply with quote

Newbie

Joined: 13 Apr 2016
Posts: 1

Hi all,

I am using IIB9 and WMQ to send messages to a queue. I wish to maintain 3 usr properties to be used for processing later. My issue is that I am able to browse the usr properties using JMS APIs on a java program. But cannot Get the messages from the queue using message selector.

Here is the code for setting usr props:

SET OutputRoot.MQRFH2.(MQRFH2.Field)Version = 2;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Format = '';
SET OutputRoot.MQRFH2.(MQRFH2.Field)Encoding = 273;
SET OutputRoot.MQRFH2.(MQRFH2.Field)CodedCharSetId = 1208;
SET OutputRoot.MQRFH2.(MQRFH2.Field)Flags = 0;
SET OutputRoot.MQRFH2.(MQRFH2.Field)NameValueCCSID = 1208;

SET OutputRoot.MQRFH2.mcd.Msd = 'jms_bytes';

SET OutputRoot.MQRFH2.usr.ENTITYID = Environment.XMLNS.ENTITYID;
SET OutputRoot.MQRFH2.usr.FUNCTION = Environment.XMLNS.FUNCTION;
SET OutputRoot.MQRFH2.usr.SEQUENCE = Environment.XMLNS.SEQUENCE;

The java code below works fine

BytesMessage msg = messages.nextElement();
String sequence = msg.getStringProperty("SEQUENCE");
String entityId = msg.getStringProperty("ENTITYID");
String function = msg.getStringProperty("FUNCTION");

However, the selector string created using these values fails to return any message.

String selector = ENTITYID='123' AND FUNCTION='CREATERECORD' AND SEQUENCE='10001'
MQQueueReceiver receiver = (MQQueueReceiver) session.createReceiver(queue, selector);
BytesMessage message = (BytesMessage) receiver.receiveNoWait();

Any help here to debug will be deeply appreciated. Thanks.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » JMS MessageSelector issue while querying
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.