Author |
Message
|
dsmq |
Posted: Wed Sep 17, 2003 5:28 am Post subject: Remove JMS header |
|
|
Acolyte
Joined: 20 Jun 2002 Posts: 59
|
Hi
My JMS program is putting the messages in the Queue with JMS( RFH2 Header) header. when i am putting the messages into the Queue how do i put the messages with out JMS header
Thanks in advance |
|
Back to top |
|
 |
EddieA |
Posted: Wed Sep 17, 2003 6:17 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
Set the targetClient attribute of the MQQueue object to JMSC.MQJMS_CLIENT_NONJMS_MQ. Or set it on the createQueue, where the value is '1'.
It's in the Java manual.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
dsmq |
Posted: Wed Sep 17, 2003 7:17 am Post subject: |
|
|
Acolyte
Joined: 20 Jun 2002 Posts: 59
|
Thanks for u r reply
But i am using JMS Queue Object. Is it possible to use that one on JMS Queue Object.
Regards |
|
Back to top |
|
 |
EddieA |
Posted: Wed Sep 17, 2003 8:56 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
From the manual, slightly modified:
Code: |
ioQueue = session.createQueue("queue://HOST1.QM1/Q1?persistence=1&targetClient=1"); |
Or
Code: |
com.ibm.mq.jms.MQQueue q1 = new com.ibm.mq.jms.MQQueue();
q1.setBaseQueueManagerName("HOST1.QM1");
q1.setBaseQueueName("Q1");
q1.setPersistence(DeliveryMode.NON_PERSISTENT);
q1.settargetClient(JMSC.MQJMS_CLIENT_NONJMS_MQ); |
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
leonwj |
Posted: Wed Sep 17, 2003 9:06 am Post subject: |
|
|
Newbie
Joined: 16 Sep 2003 Posts: 4 Location: Boston, MA
|
The most flexible way to achieve this via JMS is to set your JNDI bindings using JMSConfig as follows:
def q(yourldapnameMQ) queue(XXX.YYYY.ZZZZ) TARGCLIENT(MQ)
Therefore, should you wish to transfer messages to a JMS target (either simultaneously or down the line) you can then use:
def q(yourldapnameJMS) queue(XXX.YYYY.ZZZZ) TARGCLIENT(JMS)
and bind to the relevant LDAP entry. Alternatively you can simply change the TARGCLIENT to JMS should you convert your code to a JMS target later.
This means that you have no code changes to make in order to switch to/from - JMS/MQ.
Hope this helps.
Regards |
|
Back to top |
|
 |
dhouldsworth |
Posted: Mon Oct 27, 2003 4:40 pm Post subject: |
|
|
Newbie
Joined: 27 Oct 2003 Posts: 3 Location: Vancouver, BC
|
I'm having the same problem in that all messages that come from JMS are put into my queue with the JMS header.
I went and did the change suggested above, but still have the JMS header in all the messages:
alter t(mytopic) targclient(MQ)
alter q(myqueue) targclient(MQ)
I have a java client using an LDAP context and MQ v5.3.
Anyone have an idea of what else might be wrong?
Thanks!
;Darren
------------------------------------
Here's a quick look at my queue and topic (setup with the IVT samples ):
InitCtx> dis q(myqueue)
FAILIFQUIESCE(YES)
QUEUE(SYSTEM.DEFAULT.LOCAL.QUEUE)
QMANAGER()
PERSISTENCE(APP)
CCSID(1208)
TARGCLIENT(MQ)
ENCODING(NATIVE)
PRIORITY(APP)
EXPIRY(APP)
VERSION(1)
InitCtx> dis t(mytopic)
FAILIFQUIESCE(YES)
BROKERDURSUBQ(SYSTEM.JMS.D.SUBSCRIBER.QUEUE)
TOPIC(MQ/PSIVT/Information)
BROKERVER(V1)
PERSISTENCE(APP)
CCSID(1208)
TARGCLIENT(MQ)
ENCODING(NATIVE)
BROKERCCDURSUBQ(SYSTEM.JMS.D.CC.SUBSCRIBER.QUEUE)
PRIORITY(APP)
EXPIRY(APP)
VERSION(1) |
|
Back to top |
|
 |
vennela |
Posted: Tue Oct 28, 2003 7:32 am Post subject: |
|
|
 Jedi Knight
Joined: 11 Aug 2002 Posts: 4055 Location: Hyderabad, India
|
That should not be the case. Maybe you app is not picking up the new definitions.
You can try this but I am not sure if it will work
Instead of
Code: |
alter q(myqueue) targclient(MQ)
|
do
Code: |
alter q(myqueue) targclient(1) |
|
|
Back to top |
|
 |
dhouldsworth |
Posted: Tue Oct 28, 2003 8:51 am Post subject: |
|
|
Newbie
Joined: 27 Oct 2003 Posts: 3 Location: Vancouver, BC
|
Nope, didn't work... ;(
I saw in another thread to cast my Queue object to an MQQueue object and call setTargetClient(1) and that works, but it doesn't make it a generic JMS client.
Code: |
final Queue ioQueue = session.createQueue( QUEUE_NAME );
((MQQueue)ioQueue).setTargetClient(1); |
Is there a way to trace what is going on with MQSeries?
;D |
|
Back to top |
|
 |
bower5932 |
Posted: Tue Oct 28, 2003 10:16 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
I've never seen the target client fail. I'd double-check that you are actually looking up the same object in your program that you created via JMSAdmin.
As far as tracing is concerned, there are details in the Using Java manual. For JMS, you need to specify:
-DMQJMS_TRACE_LEVEL=base
and then you'll just have to look through the trace hoping to see something that sheds some light. |
|
Back to top |
|
 |
dhouldsworth |
Posted: Tue Oct 28, 2003 11:02 am Post subject: |
|
|
Newbie
Joined: 27 Oct 2003 Posts: 3 Location: Vancouver, BC
|
Quote: |
I'd double-check that you are actually looking up the same object in your program that you created via JMSAdmin. |
Bingo! I probably don't have the right terminology here, but...
I was getting the queue connection factory from LDAP and creating my queue manually:
Code: |
ioQueue = queueSession.createQueue( "clq_default_dhouldsworth" ); |
What I actually wanted to do was get my queue from an LDAP lookup, but as you can see above, "myqueue" was pointing to "SYSTEM.DEFAULT.LOCAL.QUEUE" instead of my "clq_default_dhouldsworth".
So I had to alter my LDAP queue object:
Code: |
alter q(myqueue) qu(clq_default_dhouldsworth) |
And then change how I got the queue reference in the Java code:
Code: |
Queue myQueue = ( Queue )ctx.lookup( "cn=myqueue" ); |
And it's all working fine now! Thanks for pointing me in the right direction guys!
;D |
|
Back to top |
|
 |
|