Author |
Message
|
sat_in_field |
Posted: Tue Jun 12, 2007 3:18 am Post subject: Retrieve 'legacy' MQ message via JMS |
|
|
Novice
Joined: 23 Jan 2003 Posts: 20
|
Hi,
We have guided by the architecture team to use JMS and have been given some code to get messages via MQ client using JMS. The issue we are having is that an existing application writes to the queue we are 'getting' from and this app does not populate the RFH2 header.
This causes our code to fail.
So using JMS can you 'get' a non JMS message from a queue. It seems quite a restriction that JMS can only get JMS compliant messages.
This must have been discussed before, please point me in the right direction.
Many Thanks
Steve |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 12, 2007 3:24 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
I'd look at TARGCLIENT in the Using Java manual (and on the forum) as a first attempt. Someone with more Java may have a better idea.  _________________ Honesty is the best policy.
Insanity is the best defence.
Last edited by Vitor on Tue Jun 12, 2007 3:24 am; edited 1 time in total |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 3:24 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
What part of your code fails? where? With what error? Is there a linked exception? _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 12, 2007 3:27 am Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
No need for an RFH2 header. Check your code.
Either your JMS code/ JNDI setup is wrong or your sending app/code does not set the proper format ... like MQFMT_STRING instead of MQFMT_NONE (default).
Should the latter be the case you should be able to receive the message as a BytesMessage. However there is no CCSID conversion for a BytesMessage...
As a point for troubleshooting I would receive the message as Message and then test the different subclasses of Message... this will tell you what kind of a message you get sent...
Have a look as well into the targetClientMatching property of the qcf.
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
sat_in_field |
Posted: Tue Jun 12, 2007 4:42 am Post subject: |
|
|
Novice
Joined: 23 Jan 2003 Posts: 20
|
We have not trapped the linked exception we are just getting MQJMS 2009 which is cannot connect to queue. However if we load the queue with a JMS message we have no issues connecting and getting that message
Weare trying to get the messages using JMS, but the message in the queue doesn't have MSD property set. JMS is failing as it mandates that that property must be present(?). The application which put the msg into the same queue, uses MQ base java not(JMS) and doesn't populate the MSD property. What must we do on the JMS side to avoid having to use this property?
One thing that may be of note is that the sending app (Non JMS) populates the RFH2 header with some data in the <usr> block |
|
Back to top |
|
 |
jefflowrey |
Posted: Tue Jun 12, 2007 4:55 am Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So there IS an RFH2 header, but it's not got ENOUGH information for JMS.
This is entirely different than having no RFH2 at all.
You *should* be capturing the linked exception - most of the JMS errors are not specific about what's going on at the provider level, and consequently pretty useless for actual troubleshooting.
I'm guessing, if the legacy application is adding stuff to <usr>, that you have written your code to depend on certain JMS Properties to be present in the message.
Which means you have written your code to depend on receiving messages from JMS (or at least from JMS or a compatible library like XMS). _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
sat_in_field |
Posted: Tue Jun 12, 2007 5:11 am Post subject: |
|
|
Novice
Joined: 23 Jan 2003 Posts: 20
|
I will code to caputure the linked exception.
The sending app(Non JMS) is an external client of our company and populates the RFH2 only with
<usr><filename>ABCD.txt</filename><usr>
The receiving app (JMS) at present cannot get the message.
Without modification of sending app, MQ QM, or queue will we be able to configure our JMS app to get this message
Thanks
Steve |
|
Back to top |
|
 |
zpat |
Posted: Tue Jun 12, 2007 5:25 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
MQRC 2009 mean the connection to queue manager is broken. We have lots of JMS application receiving "non-JMS" messages so it's not a restriction. |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 12, 2007 1:23 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
jefflowrey wrote: |
So there IS an RFH2 header, but it's not got ENOUGH information for JMS.
This is entirely different than having no RFH2 at all.
You *should* be capturing the linked exception - most of the JMS errors are not specific about what's going on at the provider level, and consequently pretty useless for actual troubleshooting.
I'm guessing, if the legacy application is adding stuff to <usr>, that you have written your code to depend on certain JMS Properties to be present in the message.
Which means you have written your code to depend on receiving messages from JMS (or at least from JMS or a compatible library like XMS). |
To troubleshoot further I would build a JMS message and inspect it with a tool like rfhutil (support pack IH03), and have a close look at the JMS and RFH information.
Then I would inspect with the same tool one of the failing messages and strive to map the differences on the RFH and message and MQMD. This should give you more clarity. Remember as well that the RFH requires you to calculate its length with a 4 byte alignment...
Enjoy  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|