Author |
Message
|
mq_novice |
Posted: Tue Jun 27, 2006 12:07 pm Post subject: unwanted text in message... |
|
|
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 |
|
 |
fjb_saper |
Posted: Tue Jun 27, 2006 3:03 pm Post subject: |
|
|
 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 |
|
 |
8davitt |
Posted: Wed Jun 28, 2006 3:31 am Post subject: |
|
|
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 |
|
 |
mq_novice |
Posted: Wed Jun 28, 2006 6:20 am Post subject: Destination.setTargetClient ? |
|
|
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 |
|
 |
Vitor |
Posted: Wed Jun 28, 2006 6:42 am Post subject: |
|
|
 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 |
|
 |
mq_novice |
Posted: Wed Jun 28, 2006 8:13 am Post subject: no stripping... |
|
|
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 |
|
 |
wschutz |
Posted: Wed Jun 28, 2006 8:42 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
|
Back to top |
|
 |
|