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 » Retrieve 'legacy' MQ message via JMS

Post new topic  Reply to topic
 Retrieve 'legacy' MQ message via JMS « View previous topic :: View next topic » 
Author Message
sat_in_field
PostPosted: Tue Jun 12, 2007 3:18 am    Post subject: Retrieve 'legacy' MQ message via JMS Reply with quote

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
View user's profile Send private message
Vitor
PostPosted: Tue Jun 12, 2007 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Jun 12, 2007 3:24 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 12, 2007 3:27 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
sat_in_field
PostPosted: Tue Jun 12, 2007 4:42 am    Post subject: Reply with quote

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
View user's profile Send private message
jefflowrey
PostPosted: Tue Jun 12, 2007 4:55 am    Post subject: Reply with quote

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
View user's profile Send private message
sat_in_field
PostPosted: Tue Jun 12, 2007 5:11 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Tue Jun 12, 2007 5:25 am    Post subject: Reply with quote

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
View user's profile Send private message
fjb_saper
PostPosted: Tue Jun 12, 2007 1:23 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » Retrieve 'legacy' MQ message via JMS
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.