Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

com.ibm.jms.JMSNullMessage

239 views
Skip to first unread message

Jordi Soldevila

unread,
Apr 4, 2006, 9:19:26 AM4/4/06
to
Hi,
The JMS Specification defines 5 message types:
StreamMessage, MapMessage, TextMessage, ObjectMessage and BytesMessage

It appears that IBM has made up its own JMS Message type for an empty
message in JMS API com.ibm.mq.jms package.
When we use the package com.ibm.mq.jms to receive messages from a queue, if
the message in the queue has no actual message body associated
with it, it appears to be of a type com.ibm.jms.JMSNullMessage which does
not implement any of the 5 known JMS Message Interfaces.

We do see that class in the com.ibm.jms.jar, but I can't find any reference
to it in the IBM JMS Documentation.

Can anybody verify that this is indeed what is occurring in the event of a
null message body and if there are any other
non-standard message types introduced with JMS API com.ibm.mq.jms package?

Thanks

Jordi Soldevila.


Phil Willoughby

unread,
Apr 4, 2006, 10:26:34 AM4/4/06
to
Jordi Soldevila wrote:
> Hi,
> The JMS Specification defines 5 message types:
> StreamMessage, MapMessage, TextMessage, ObjectMessage and BytesMessage

Actually the JMS specification defines 6 types of message -
javax.jms.Message is a message type in its own right. It may not be
very useful, but it does exist.

> Can anybody verify that this is indeed what is occurring in the event of a
> null message body and if there are any other
> non-standard message types introduced with JMS API com.ibm.mq.jms package?

I can't comment on the internals of our JMS implementation. If you want
to make your application dependant on WebSphere MQ rather than allowing
it to be portable to other JMS implementations there are easier ways to
do it -- use the WebSphere MQ classes for Java (colloquially MQJAVA) for
instance.

Regards,

Phil Willoughby
--
Software Engineer (Development)
IBM Message Service Clients for C/C++

Brian Cope

unread,
Apr 12, 2006, 10:23:16 AM4/12/06
to
All JMS messages are ultimately of a concrete class implementing
javax.jms.Message. WebSphere MQ JMS provides 6 such classes; one for each
of the 5 types, and one to enable a message with no body to be used. You
shouldn't need to worry about the actual concrete class, just that you have
an object of some type that implements javax.jms.Message but none of the 5
extended interfaces (i.e. you have a JMS message with no body).

So this isn't an extension to JMS as such, simply the way the WebSphere MQ
JMS has implemented messages that are of the '6th' type implicitly mentioned
in the JMS spec. There are no non-standard JMS message types provided byt
WebSphere MQ JMS.

(btw, a message with no body can be useful in some situations, e.g. when all
you need is a response to a request, with no information, or perhaps just
some properties like 'status=OK', 'orderNumber=12345')

Brian

"Phil Willoughby" <phil.wi...@uk.ibm.com> wrote in message
news:e0tvms$30g3a$1...@news.boulder.ibm.com...

0 new messages