When I build a bridge (using Camel 2.7.1) from an Oracle AQ topic to a
WebSphere queue with
from(srcJms).inOnly() // origin
.onException(Exception.class).[...].end() // exception handling
.throttle(10).timePeriodMillis(1 * 1000) // throttling
.wireTap(recorder) // recording
.to(dstJms); // destination
then the messages are not delivered. The WebSphere specific message creation
fails with
org.springframework.jms.MessageFormatException:
JMSCC0050: JMSCC0050: The property name 'JMS_OracleDelay' is
reserved and cannot be set.;
nested exception is
com.ibm.msg.client.jms.DetailedMessageFormatException:
JMSCC0050: The property name 'JMS_OracleDelay' is reserved and
cannot be set. The supplied property name begins with the JMS prefix, but is
not one of the supported, settable properties. Check the property name and
correct errors.
It looks like that - in general - every message will be rejected if it
contains such headers starting with 'JMS_'.
My workaround is to remove the suspicious headers like this:
from(srcJms).inOnly() // origin
.onException(Exception.class).[...].end() // exception handling
.throttle(10).timePeriodMillis(1 * 1000) // throttling
.wireTap(recorder) // recording
>>>>> .removeHeaders("JMS_Oracle*") // getting rid of headers
unsupported by WebSphere
.to(dstJms); // destination
But what if I plan to replace the Oracle JMS with Weblogic or ActiveMQ?
Probably I will have to touch the code again to replace other JMS
properties!?
So, my question is: Could or should Camel take care of the WebSphere message
creation... to be independent from where (which JMS server) the message
comes from?
By the way, these are my endpoints:
final String srcJms = "local-srv:topic:" + "MY_TOPIC_NAME" + "?"
+ "jmsMessageType=" + JmsMessageType.Bytes + "&"
+ "concurrentConsumers=1" + "&"
+ "recoveryInterval=10000" + "&"
+ "durableSubscriptionName=" + "MY_SUBSCRIPTION_NAME" + "&"
+ "clientId=" + "MY_APPLICATION_NAME" + "&"
+ "transacted=" + Boolean.TRUE;
final String dstJms = "remote-srv:queue:" + "MY_QUEUE_NAME" + "?"
+ "jmsMessageType=" + JmsMessageType.Bytes + "&"
+ "recoveryInterval=60000";
final String recorder = "file://test?"
+ "fileName=.dumped/" +
"processed_${date:now:yyyy.MM.dd-HH.mm.ss.SSS}.txt";
And these are my Spring injected beans to decouple the JMS server
connectivity:
<bean id="local-srv" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean
class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter">
<property name="targetConnectionFactory">
<bean id="topicConnectionFactory"
class="oracle.jms.AQjmsFactory" factory-method="getTopicConnectionFactory">
<constructor-arg index="0"
value="jdbc:oracle:thin:@DBHOST:1521:SAMPLESID"/>
<constructor-arg index="1" type="java.util.Properties">
<props>
<prop key="v$session.program">My Application
Name</prop>
</props>
</constructor-arg>
</bean>
</property>
<property name="username" value="anonymous"/>
<property name="password" value="secret"/>
</bean>
</property>
<property name="acknowledgementModeName" value="AUTO_ACKNOWLEDGE"/>
</bean>
<bean id="remote-srv"
class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory">
<bean class="com.ibm.mq.jms.MQConnectionFactory">
<property name="hostName" value="SAMPLEHOST"/>
<property name="port" value="1414"/>
<property name="queueManager" value="QM_SAMPLEHOST"/>
<property name="transportType">
<util:constant
static-field="com.ibm.msg.client.wmq.WMQConstants.WMQ_CM_CLIENT"/>
</property>
</bean>
</property>
<property name="acknowledgementModeName" value="AUTO_ACKNOWLEDGE"/>
</bean>
--
View this message in context:
http://camel.465427.n5.nabble.com/WebSphere-MQ-bridging-messages-from-Oracle-AQ-fails-with-com-ibm-msg-client-jms-DetailedMessageFormat-tp4390504p4390504.html
Sent from the Camel - Users mailing list archive at Nabble.com.