Hi,
I'm testing ServiceMix 3.3.1 and trying to do the following :
WebsphereMQ ---> servicemix-jms-su ---> servicemix-file-su --> local
directory
With the following servicemix-jms-su configuration :
...
<jms:endpoint service="tut:mq2file"
endpoint="mq"
targetService="tut:mq2file"
role="consumer"
targetEndpoint="sender"
destinationStyle="queue"
jmsProviderDestinationName="QUEUE_NAME"
connectionFactory="#mqConnectionFactory"
defaultMep="http://www.w3.org/2004/08/wsdl/in-only" />
<bean id="mqConnectionFactory"
class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType">
<util:constant
static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP" />
</property>
<property name="queueManager" value="QMGR" />
<property name="hostName" value="HOST" />
<property name="channel" value="SYSTEM.DEF.SVRCONN" />
<property name="port" value="PORT" />
</bean>
<classpath>
<location>/tmp/apache-servicemix-3.3.1/lib/ext/com.ibm.mqjms.jar</location>
<location>/tmp/apache-servicemix-3.3.1/lib/ext/com.ibm.mq.jar</location>
<location>/tmp/apache-servicemix-3.3.1/lib/ext/dhbcore.jar</location>
</classpath>
...
It works very well when I post an xml message in the queue (the message gets
written in a file). But the real messages I'll have to send will be plain
text (fixed length) and these are not accepted...
So I tried another way, as seen here and there on the web. With that
configuration :
...
<jms:consumer service="tut:mq2file"
endpoint="mq"
targetService="tut:mq2file"
targetEndpoint="sender"
destinationName="QUEUE_NAME"
connectionFactory="#mqConnectionFactory"
marshaler="#myMarshaler" />
<bean id="myMarshaler"
class="org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler">
<property name="mep" value="http://www.w3.org/2004/08/wsdl/in-only" />
</bean>
<bean id="mqConnectionFactory"
class="com.ibm.mq.jms.MQQueueConnectionFactory">
<property name="transportType">
<util:constant
static-field="com.ibm.mq.jms.JMSC.MQJMS_TP_CLIENT_MQ_TCPIP" />
</property>
<property name="queueManager" value="QMGR" />
<property name="hostName" value="HOST" />
<property name="channel" value="SYSTEM.DEF.SVRCONN" />
<property name="port" value="1414" />
</bean>
...
The SA deployment is fine, but if I send the same xml message (the one sent
with the first configuration) I get the following exception :
WARN - DefaultMessageListenerContainer - Execution of JMS message listener
failed
javax.jms.JMSException: Error sending JBI exchange
at
org.apache.servicemix.jms.endpoints.AbstractConsumerEndpoint.onMessage(AbstractConsumerEndpoint.java:575)
at
org.apache.servicemix.jms.endpoints.JmsConsumerEndpoint$1.onMessage(JmsConsumerEndpoint.java:505)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doInvokeListener(AbstractMessageListenerContainer.java:518)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.invokeListener(AbstractMessageListenerContainer.java:479)
at
org.springframework.jms.listener.AbstractMessageListenerContainer.doExecuteListener(AbstractMessageListenerContainer.java:451)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.doReceiveAndExecute(AbstractPollingMessageListenerContainer.java:323)
at
org.springframework.jms.listener.AbstractPollingMessageListenerContainer.receiveAndExecute(AbstractPollingMessageListenerContainer.java:261)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:982)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.executeOngoingLoop(DefaultMessageListenerContainer.java:974)
at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:876)
at java.lang.Thread.run(Thread.java:736)
Caused by:
java.lang.UnsupportedOperationException: JMS message is not a TextMessage
at
org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler.populateMessage(DefaultConsumerMarshaler.java:183)
at
org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler.createExchange(DefaultConsumerMarshaler.java:99)
at
org.apache.servicemix.jms.endpoints.AbstractConsumerEndpoint.onMessage(AbstractConsumerEndpoint.java:544)
... 10 more
If I send a non-xml message, I get the same exception.
Has anyone succeeded using directly the
org.apache.servicemix.jms.endpoints.DefaultConsumerMarshaler class ?
Thanks for any hint... I'm a bit lost...
PS : this is only the first step, there will be more actions on the message
(fixed length to xlm conversion, xslt transformation, xml to fixed length
conversion and post back to a queue... ) and the idea is to avoid any coding
(if possible).
--
View this message in context:
http://old.nabble.com/servicemix-jms-consumer-with-non-xml-messages-tp28167771p28167771.html
Sent from the ServiceMix - User mailing list archive at Nabble.com.