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 » unwanted text in message...

Post new topic  Reply to topic
 unwanted text in message... « View previous topic :: View next topic » 
Author Message
mq_novice
PostPosted: Tue Jun 27, 2006 12:07 pm    Post subject: unwanted text in message... Reply with quote

Novice

Joined: 26 Jun 2006
Posts: 13

now that I can send message to the queue...

Code:

QueueSender sender = session.createSender(queue);
sender.send(session.createTextMessage("1234"));


and when I check the actual QUEUE, I see below unwanted text along with the message I sent...

Code:

RFH ............
....MQSTR   ....
....... <mcd><Ms
d>jms_text</Msd>
</mcd>  ...X<jms
><Dst>queue:///T
EST.TESTINGQUEUE
S</Dst><Tms>1151
437819484</Tms><
Dlv>2</Dlv></jms
 >   1234


Can I just send "1234" ?[/b]
Back to top
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 27, 2006 3:03 pm    Post subject: Reply with quote

Grand High Poobah

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

What you are seeing is the standard MQRFH header (also used in pub/sub). This is a standard in JMS and gets stripped.
If you do not want the header to be on the message you have to define your destination queue as being 'MQ" type and not "JMS" in JNDI or if created withing the session:
Code:
session.createQueue("queue://qmgr/queuename?targetClient=1")


Enjoy
_________________
MQ & Broker admin
Back to top
View user's profile Send private message Send e-mail
8davitt
PostPosted: Wed Jun 28, 2006 3:31 am    Post subject: Reply with quote

Apprentice

Joined: 06 Feb 2003
Posts: 37
Location: Seated in front of monitor

Probably clearer and more explicit is to use the method Destination.setTargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ)

See reference docs in Using Java Chapter 15

or better yet create a Destination (Queue, Topic) with the property TARGCLIENT(MQ).

As always refer to the docs. Using Java Chapter 13 Section 'Mapping JMS to a native Websphere MQ application'

/s
Back to top
View user's profile Send private message
mq_novice
PostPosted: Wed Jun 28, 2006 6:20 am    Post subject: Destination.setTargetClient ? Reply with quote

Novice

Joined: 26 Jun 2006
Posts: 13

Thanks for the reply guys.

I don't really see the method Destination.setTargetClient...
Is that a MQ specific? I'm trying to do this without any MQ specific code.. just with all JMS codes...

thanks for the reference to the documentation.. read that as well right now.

Thanks alot guys
!
Back to top
View user's profile Send private message
Vitor
PostPosted: Wed Jun 28, 2006 6:42 am    Post subject: Reply with quote

Grand High Poobah

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

All this is MQ specific - behold:

Quote:
A Destination object encapsulates a provider-specific address. The JMS API does not define a standard address syntax. Although a standard address syntax was considered, it was decided that the differences in address semantics between existing message-oriented middleware (MOM) products were too wide to bridge with a single syntax.



(Java 2 specification of the Destination object http://java.sun.com/j2ee/sdk_1.3/techdocs/api/javax/jms/Destination.html)

Because of the encapsulation, you will find provider-specific codes in use at this level. Even if you used a different JMS provider, something like the RFH2 will probably turn up and need to be suppressed for non-JMS applications.

Conflicting views welcomed - Java is by no means my strongest language!
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
mq_novice
PostPosted: Wed Jun 28, 2006 8:13 am    Post subject: no stripping... Reply with quote

Novice

Joined: 26 Jun 2006
Posts: 13

it seems to be that stripping header is impossible without using MQ specific code...

I'm going to try the createQueue and will let you know if any success...
Back to top
View user's profile Send private message
wschutz
PostPosted: Wed Jun 28, 2006 8:42 am    Post subject: Reply with quote

Jedi Knight

Joined: 02 Jun 2005
Posts: 3316
Location: IBM (retired)

No, you can either specify in your code (via the setTargetClient method), or in the admin tool (via the TARGCLIENT property). If you use the admin tool, you can have "pure" JMS code.

See:

http://publib.boulder.ibm.com/infocenter/wmqv6/v6r0/index.jsp?topic=/com.ibm.mq.csqzaw.doc/pcomp.htm
_________________
-wayne
Back to top
View user's profile Send private message Send e-mail AIM Address
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » unwanted text in message...
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.