Hi Ivanhoe,
ServiceMix is build around JBI, which uses XML payload over the NMR
when transmitting data between endpoints. The JMS endpoint is trying
to turn the incoming message into an XMLInputStream, and is unable to
modify your JMS object message.
To get around this, you could use a binary marshaller, which will
effectively transmit the object as an attachment to a JBI-compliant
XML message on the NMR. I don't have a code-snippit handy but I'm sure
you can find one on the ServiceMix web site.
The other approach might be to deploy a Camel route in ServiceMix
(using the camel-component) - Camel doesn't enforce a canonical XML
payload, so this might be more appropriate for your solution.
Best,
Ade
On 19 Nov 2008, at 07:05, Ivanhoe Abrahams wrote:
Hi All
I have a situation where I would like to wiretap communications going
through to a service which allows communication via a jms queue
Currently this application simply requires one to start up activemq
as a
broker and then every thing works OK.
Now I would like to, (instead of starting up ActiveMQ) start up SMX4
and
allow for queses to be registered etc. This part also works fine, the
consumer service finds the registered queue in the underlying activemq
instance of SMX4 and communication takes place between the consumer
service
and the producer service....
The problem start when I actually create a service assembly which
contains a
jms-su with the following endpoint defined
<jms:endpoint service="test:jms"
endpoint="consumer"
role="consumer"
destinationStyle="queue"
jmsProviderDestinationName="test-check_queue"
connectionFactory="#connectionFactory" />
I also have a Camel RouteBuilder in which I would like to pick up
messages
from the above jms endpoint and log some information at that point.
But as soon as communication takes place i get the following
exception.
08:34:02,171 | ERROR | mix-jms-thread-2 |
MultiplexingConsumerProcessor |
.MultiplexingConsumerProcessor$1 101 | Error while handling jms
message
java.lang.UnsupportedOperationException: Can not handle objects of
type
org.springframework.remoting.support.RemoteInvocation
at
org
.apache
.servicemix
.jms.DefaultJmsMarshaler.toXmlInputStream(DefaultJmsMarshaler.java:
150)
at
org
.apache
.servicemix.jms.DefaultJmsMarshaler.toSOAP(DefaultJmsMarshaler.java:
178)
at
org
.apache
.servicemix.jms.AbstractJmsProcessor.toNMS(AbstractJmsProcessor.java:
220)
at
org
.apache
.servicemix.jms.multiplexing.MultiplexingConsumerProcessor.access
$300(MultiplexingConsumerProcessor.java:37)
at
org.apache.servicemix.jms.multiplexing.MultiplexingConsumerProcessor
$1.run(MultiplexingConsumerProcessor.java:95)
at
java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:650)
at
java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:675)
The communication on the external services side uses spring remoting
so the
consumer service communicates with the producer service via the
queue and
uses normal rpc-like calls on a java interface/impl which is
exported using
spring
JmsInvokerServiceExporter and JmsInvokerProxyFactoryBean etc. etc....
What I would like to know is what I should do/configure to be able to
consume and produce jms messages coming in for a service that uses
Spring
remoting technology.
Note: that the external services' (both the client and server) have
already
been coded and we cannot change the way they communicate?
Thank you in advance
ICA
---
Adrian Trenaman, Consultant Fellow, PS - Opensource Center of Competence
Progress Software Corp
Shelbourne Road, Dublin 4, Ireland
---
+353-1-637-2659 (Office)
+353-1-637-2882 (Fax)
+353-86-6051026 (Mobile)
adrian.trenaman (Skype)
----
Blog: http://trenaman.blogspot.com