私はapache-camelソリューションを使用しているアプリケーションを持っていて、Websphere MQ Serverにjmsを通してメッセージを送信したい場合は、jmsプロパティJMS_IBM_MQMD_MsgId
をMQMDフィールドMQMD.MsgId
に変換してください。Apache Camel - Websphere MQ統合
exchange.getIn().setHeader(WMQConstants.JMS_IBM_MQMD_MSGID, "XXXXXXXXXXXXXXXXXXXXXXXX".getBytes());
Apache Camel - IBM MQ integrationによると、宛先オブジェクトに別のプロパティ設定が必要なようです。参照宛先のJMSプロバイダーオプションをに設定すると、http://camel.apache.org/jms.htmlには、宛先オブジェクト用にmdWriteEnabled
、mdReadEnabled
と設定して、ラクダjmsコンポーネントのカスタムDestinationResolverを提供します。
<bean id="ibmMQServer01" class="org.apache.camel.component.jms.JmsComponent">
<property name="connectionFactory" ref="ibmMQCredentialConnectionFactory01" />
<property name="destinationResolver" ref="wmqDestinationResolver" />
</bean>
と
public class WMQDestinationResolver implements DestinationResolver {
@Override
public Destination resolveDestinationName(Session session, String destinationName,
boolean pubSubDomain) throws JMSException {
MQSession mqSession = (MQSession) session;
MQQueue queue = (MQQueue) mqSession.createQueue("queue:///" + destinationName);
queue.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
queue.setBooleanProperty(WMQConstants.WMQ_MQMD_READ_ENABLED, true);
queue.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, WMQConstants.WMQ_MDCTX_SET_ALL_CONTEXT);
return queue;
}
}
mdReadEnabled
を設定することがtrueの間、私は受信機にJMS_IBM_MQMD_MsgId
を得ることができます。しかし、mdWriteEnabled
は私にとってはうまくいかず、JMS_IBM_MQMD_MsgId
が予期しない値AMQ CS.QA.CBSA.Q�Y�b
(バイト[]から解析された、完全に24バイト)となります。
受信したJMSMessageID
はID:414d512043532e51412e434253412e511987055902cc6222
であり、これは上記の乱雑な文字列に解析することができます。
アップストリームでこれを処理するためにApache Camelにバグレポートを提出する方法はありますか? – JoshMc