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 » How do I set routing params with in JMS for MQ?

Post new topic  Reply to topic
 How do I set routing params with in JMS for MQ? « View previous topic :: View next topic » 
Author Message
fredand44
PostPosted: Tue Mar 25, 2008 10:30 am    Post subject: How do I set routing params with in JMS for MQ? Reply with quote

Acolyte

Joined: 14 Feb 2006
Posts: 63

Hello!

(You all have probably seen my prev message).

I try to ask it in an better way.

I need to set params in a JMS-message that a MQ-broker should use for routing.

I thought that the following should do the trick:
BytesMessage message = session.createBytesMessage();
//The data
message.writeBytes("hubba".getBytes());
//The routing param
message.setStringProperty("testkey", "testvalue");

But when I consume the message like:
Message message = queueReceiver.receiveNoWait();
if(message instanceof BytesMessage)
{
System.out.println("param: " + message.getStringProperty("testkey") );
}

I just get: "null" ?????

I have also tried to view the message with rfhutil.exe
But I can not see any trace of the routing param?

So please if any one have any idea how to set the routing param properly please tell me!

Best regards
Fredrik

Back to top
View user's profile Send private message
fredand44
PostPosted: Tue Mar 25, 2008 11:37 am    Post subject: I think I got it!! Reply with quote

Acolyte

Joined: 14 Feb 2006
Posts: 63

Hello!

I do not nearly believe my self, but I think I found the error.

When I set up the jndi I set TARGCLIENT(MQ).

I found out that it probably should be TARGCLIENT(JMS)

Then it looks that I can read all setXXXProperties.

Best regards
Fredrik
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Mar 25, 2008 11:39 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981



Yes, that should have been the problem.

Good job!
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Mar 25, 2008 12:13 pm    Post subject: Re: I think I got it!! Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

fredand44 wrote:
When I set up the jndi I set TARGCLIENT(MQ).

I found out that it probably should be TARGCLIENT(JMS)


For the record, unless the target client is JMS then the JMS headers (including where your information is stored) are stripped out.

But well done you for finding it!
_________________
Honesty is the best policy.
Insanity is the best defence.
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 » How do I set routing params with in JMS for 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.