views:

499

answers:

4

I'm trying to send a message to a java server over a Websphere MQ which uses JMS as the transport protocol. I can happily drop messages on the MQ using the IBM supplied libraries, but the server rejects them. I'm assuming (hopefully correctly) that this is because I'm missing various JMS specific headers/properties on the MQ message.

I have ensured the payloads for the messages are the same by inspecting the queue (they are both map messages if that helps), but don't want to fully implement the JMS Websphere MQ protocol just to get this to work.

I'm wondering if anyone has managed to get this to work, and if so what's the minimum amount of information you need to specify in the JMS header? Are there any alternatives to doing this directly on the MQ (I've seen some about using java interop, but this is something I think would be overkill).

Any help would be greatly appreciated!

+2  A: 

Can you paste the Java code you are using to read the message. Is that code assuming that the message is a "MapMessage". Normally something put into a Queue from a non-java client will appear as either a TextMessage or a BytesMessage.

The WebsphereMQ JMS api is normally fine with reading those messages without the JMS headers as long as you read as a TextMessage / BytesMessage as put.

In my server code, my content is normally put to the queue as bytes, and so appears as a BytesMessage, but just in case i get a message that was manually put on the queue, i catch the classcastexception, and test to see if it is in fact a TextMessage.

Tom Sorgie
The java code is expecting a MapMessage. I think it would be nice to change this in a future release to use a TextMessage and decode the contents explicitly. Does putting a map message on the wire do anything else regarding extra JMS headers?
jonnii
+1  A: 

Websphere MQ doesn't have very clear error messages. The things I suggest to check when something went wrong are:

  1. Exception details and their recursive causes.
  2. MQ error logs.
  3. Event logs sourced by MQ.
  4. .fdk files.
Dr. Xray
+1  A: 

Are you trying to use MQI to send JMS messages? Take a look at the XMS libraries from IBM. They will provide everything that you need. The libraries provide a .NET implementation of JMS that works with WebsphereMQ. I have used these libs many times over the past year, talking between java and .net systems, and have been very happy with the functionality.

XMS .NET Library Download

gwhitake
Thanks, I'll take a look at this.
jonnii
A: 

I think I had the same problem and I couldn't get XMS to work. In case it's still a problem to you, this might help: http://www.mqseries.net/phpBB2/viewtopic.php?p=198644&sid=efbb10decf21571db28419df07353810 - regards Kristoffer

Kristoffer Olsson