【发布时间】:2017-12-15 00:31:47
【问题描述】:
我们想从 MQ Header 上的 ApplIdentityData 中提取信息。但在消费者方面,我们没有看到 ApplIdentityData 对应的 JMS 标头。我确实跟踪了日志,但没有找到任何与 ApplIdentityData 相关的信息。
我正在使用 Apache Camel 来读取 MQ 并处理队列消息。在骆驼跟踪日志中,我没有找到 ApplIdentityData 的任何内容。你能帮帮我吗?
下面是 MQ 消息头和 Camel 文件:
StrucId : 'MD ' Version : 2
Report : 0 MsgType : 8
Expiry : -1 Feedback : 0
Encoding : 273 CodedCharSetId : 819
Format : 'MQSTR '
Priority : 0 Persistence : 1
MsgId : X'414D51204445544C4437513120202020594010C12E08AD2B'
CorrelId : X'000000000000000000000000000000000000000000000000'
BackoutCount : 0
ReplyToQ : ' '
ReplyToQMgr : 'etlQ07 '
** Identity Context
UserIdentifier : ' '
AccountingToken :
X'0000000000000000000000000000000000000000000000000000000000000000'
ApplIdentityData : 'TEST_HEADER_BADRI_DEC5'
** Origin Context
PutApplType : '6'
'
PutDate : '20171205' PutTime : '08285663'
ApplOriginData : ' '
GroupId : X'414D51204445544C4437513120202020594010C12E08AD2C'
MsgSeqNumber : '1'
Offset : '0'
MsgFlags : '1'
OriginalLength : '-1'
骆驼档案:
<!-- Recs Prem Cash MQ Configuration START -->
<camel:route id="rp-cash-mq-route">
<camel:setHeader headerName="CamelCharsetName"><camel:constant>UTF-8</camel:constant></camel:setHeader>
<camel:setHeader headerName="endpoint.error.folder"><camel:constant>file:///usr/local/clo/data/tlm/fuse/archive/failed</camel:constant></camel:setHeader>
<camel:setHeader headerName="route.accessAreaId"><camel:simple resultType="Long">1</camel:simple></camel:setHeader>
<camel:setHeader headerName="mi-endpoint"><camel:constant>st-csv-in</camel:constant></camel:setHeader>
<camel:setHeader headerName="CamelFileName"><camel:simple>${header.JMS_IBM_MQMD_ApplIdentityData}</camel:simple></camel:setHeader>
<camel:to uri="direct:st-csv-in"/>
</camel:route>
<!-- Recs Prem Cash MQ Configuration END -->
【问题讨论】:
-
您能否提供骆驼配置,说明您如何尝试检索消息 ApplIdentityData 值?
-
附加了我的骆驼文件...下面是我启用 MQMD 的部分,但仍然没有在消费者上获得相应的 JMS 值
-
试试
<property name="mdReadEnabled" value="true" />,如果可行,我会写一个快速的答案让你接受。 -
@JoshMc ,我尝试使用提到的属性:
错误 - ]:无法解析字符串值“${jms.queue}”中的占位符“jms.queue”;嵌套异常是 java.lang.IllegalArgumentException: 无法解析字符串值 "${jms.queue}"中的占位符 'jms.queue' 错误 - bean 类 [com.ibm.mq.jms.MQQueue 的无效属性“mdReadEnabled”
标签: apache-camel ibm-mq