Hello Ben

Sorry. I don't know anything more about this. Here is my understanding. Maybe someone else can confirm/deny.

* ServiceMix JMS components only work for JMS TextMessage, and furthermore assume that the TextMessage data is valid XML

* These restrictions are only because that's just how the JmsMarshaler (marshaller used by the JMS components) works

* But if you really wanted something different there's nothing stopping you writing & substituting your own JmsMarshaler subclass to marshal/unmarshal the JMS Message to the NM in your own particular way.

So long as you have to remember not to violate the JBI specification.... For example,

<quote>
5.1.2 Normalized Message
JBI uses the concept of a “normalized” message for interaction between consumers and providers. A normalized message consists of three main parts:
* The “payload”, or bare message: an XML document that conforms to an abstract WSDL message type, without any protocol encoding or formatting. (This is not a canonical form for the message.)
* Message properties (sometime called metadata). These hold extra data associated with the message, gained during the processing of the message. Such properties can include security information (security principal for digital signers of received messages, for example), transaction context information, and component-specific information.
* Message attachments. A portion of the content of the “payload” (content) of the message can be made up of attachments, referenced by the payload, and contained within a data handler that is used to manipulate that contents of the attachment itself. Such attachments can be non-XML data.
</quote>

also

<quote>
5.3.4 Binary Inclusion
The primary content of a normalized message is always XML; non-XML (including binary) attachments to the primary content are supported through use of the Java Activation Framework, and normalized message attachments.
</quote>

To summarize: The NM payload of the NM *must* be XML. It's the spec. But it also seems possible to "attach" some non-XML data (eg from your JMS Message) to your NM if you really wanted to (by writing your own marshaller). But then there are a bunch more spec rules to consider that describe how the NM attachments must be referenced from the NM payload.

Sending a simple non-XML "Hello World" String across a wire does not seem like a trivial exercise :-) But I don't know for sure because I haven't tried to do it. Maybe somebody has already done this and can provide more details.

Cheers,
Peter

Ben Wu wrote:
Hi, Peter:
 
        I encounter this problem with the ActiveMQ3.2X2+serviceMix2.02X1 too.  The serviceMix jms-binding example works well for me, but when I try to use Spring JmsTemplate to send and receive message, it seems that NMR really expects XML format message.  Does anyone give you any solution for this issue?
 
Thank you so much for your sharing.
 
                  Ben Wu, Taiwan


Reply via email to