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 API Support » XMS client for JMS MQ

Post new topic  Reply to topic Goto page Previous  1, 2
 XMS client for JMS MQ « View previous topic :: View next topic » 
Author Message
fjb_saper
PostPosted: Thu Jan 22, 2009 2:17 pm    Post subject: Reply with quote

Grand High Poobah

Joined: 18 Nov 2003
Posts: 20757
Location: LI,NY

Quote:
consumer=sess.createConsumer(dest);
consumer.setMessageListener(msgListener);
conn.start();

xms::Message *pBase = NULL;
pBase = consumer.receive(70000);

Looking at that piece of code there are other things that make little sense.
You are attaching a message listener to the the consumer.
But then you are using consumer.receive ?
What about the code in the onMessage() method in your message Listener???

Like Jeff said your sending program needs to specify that it is sending a TextMessage. This is done in JMS/XMS by sending an actual TextMessage (class). Others (broker) can construct it by making sure that the RFH header contains the format MQFMT_STRING in the format field related to the next section of the message.

Have fun

You could also verify your XMS code by creating a message using RFHUtil and see how that goes.
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
shashikanth_in
PostPosted: Thu Feb 26, 2009 4:38 am    Post subject: Reply with quote

Centurion

Joined: 26 Feb 2009
Posts: 123

Hello,

I would like to know the reason for having message listener and then call receive for the same consumer. I suggest you remove one of them, either have the message listener or receive call.

The second point. It appears that XMS is unable to recognize the type of the message your application is receiving and hence defaulting to XMS_MESSAGE_TYPE_BASE. This type of message will not have any body. So when attempting cast message with empty body to a TextMessage, I think the text message is getting created with a null body. So getText is having a problem.

It's always good to first determine the type of the message and then cast the message accordingly. Please look at SampleConsumerCpp for more detail.

Thanks
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Goto page Previous  1, 2 Page 2 of 2

MQSeries.net Forum Index » IBM MQ API Support » XMS client for JMS MQ
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.