You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

TIBCO BWCE发送消息时MQMD的ApplIdentityData字段未传递至IBM MQ

问题:TIBCO BWCE 2.10 JMS Send组件无法传递IBM MQ的MQMD ApplIdentityData字段

我在使用TIBCO BWCE Studio 2.10的JMS Send组件向IBM MQ发送消息时,需要将MQMD的ApplIdentityData字段传递给接收应用。消息能正常送达IBM MQ接收应用(MQ连接正常),但该字段未成功传递。

当前JMS Send配置

destination = "queue:///<MQQUEUE>?targetClient=1"
replyTo = <Reply.Q>
OtherProperties (非DynamicProperties)
WMQ_MQMD_WRITE_ENABLED = true
JMS_IBM_MQMD_ApplIdentityData = "SampleValue"

JMSSend的XSLT代码

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tns="http://www.tibco.com/namespaces/tnt/plugins/jms+4779da9c-86d7-4bca-817b-eaac428edc1e+input" xmlns:ns="http://www.tibco.com/namespaces/tnt/plugins/jms+71351883-8751-4753-9a62-91ef666e1899+output" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:bw="http://www.tibco.com/bw/xpath/bw-custom-functions" xmlns:tib="http://www.tibco.com/bw/xslt/custom-functions" version="2.0">
    <xsl:param name="ReceiveFromJMS"/>
    <xsl:param name="MQHeaderWriteEnabled"/>
    <xsl:template name="SendToMQ-input" match="/">
        <tns:ActivityInput>
            <destination>
                <xsl:value-of select="'queue:///SAMPLE.MQ.QUEUE?targetClient=1'"/>
            </destination>
            <replyTo>
                <xsl:value-of select="'SAMPLE.MQ.QUEUE.REPLY'"/>
            </replyTo>
            <xsl:if test="$ReceiveFromJMS/JMSHeaders/ns:JMSPriority">
                <JMSPriority>
                    <xsl:value-of select="$ReceiveFromJMS/JMSHeaders/ns:JMSPriority"/>
                </JMSPriority>
            </xsl:if>
            <JMSProperties/>
            <Body>
                <xsl:value-of select="if (upper-case(bw:getModuleProperty(&quot;/MQJMS/Encoding_ToMQ&quot;))='BASE64') then tib:string-to-base64($ReceiveFromJMS/Body) else if (upper-case(bw:getModuleProperty(&quot;/MQJMS/Encoding_ToMQ&quot;))='HEX') then tib:string-to-hex($ReceiveFromJMS/Body) else $ReceiveFromJMS/Body"/>
            </Body>
            <DynamicProperties/>
            <tns:OtherProperties>
                <WMQ_MQMD_WRITE_ENABLED>
                    <xsl:value-of select="$MQHeaderWriteEnabled"/>
                </WMQ_MQMD_WRITE_ENABLED>
                <WMQ_MQMD_MESSAGE_CONTEXT>
                    <xsl:value-of select="&quot;WMQ_MDCTX_SET_ALL_CONTEXT&quot;"/>
                </WMQ_MQMD_MESSAGE_CONTEXT>
                <JMS_IBM_MQMD_ApplIdentityData>
                    <xsl:value-of select="&quot;TEST&quot;"/>
                </JMS_IBM_MQMD_ApplIdentityData>
                <JMS_IBM_MQMD_ApplOriginData>
                    <xsl:value-of select="&quot;41&quot;"/>
                </JMS_IBM_MQMD_ApplOriginData>
                <JMS_IBM_MQMD_Format>
                    <xsl:value-of select="&quot;MQSTR&quot;"/>
                </JMS_IBM_MQMD_Format>
            </tns:OtherProperties>
        </tns:ActivityInput>
    </xsl:template>
</xsl:stylesheet>

解决方案

  • 确认WMQ_MQMD_WRITE_ENABLED的实际值
    确保XSLT中$MQHeaderWriteEnabled参数传递的是布尔值true,而非字符串"true"。可临时在XSLT中硬编码测试:

    <WMQ_MQMD_WRITE_ENABLED>true</WMQ_MQMD_WRITE_ENABLED>
    
  • 调整消息上下文属性
    当前设置的WMQ_MDCTX_SET_ALL_CONTEXT会强制覆盖所有MQMD字段,可能与MQ权限或配置冲突。建议改为仅设置身份相关字段的WMQ_MDCTX_SET_IDENTITY_CONTEXT:

    <WMQ_MQMD_MESSAGE_CONTEXT>
        <xsl:value-of select="'WMQ_MDCTX_SET_IDENTITY_CONTEXT'"/>
    </WMQ_MQMD_MESSAGE_CONTEXT>
    
  • 切换到DynamicProperties传递属性
    将JMS_IBM_MQMD_ApplIdentityData和WMQ_MQMD_WRITE_ENABLED从OtherProperties移到DynamicProperties中,部分场景下DynamicProperties优先级更高:

    <DynamicProperties>
        <entry>
            <key>JMS_IBM_MQMD_ApplIdentityData</key>
            <value>TEST</value>
        </entry>
        <entry>
            <key>WMQ_MQMD_WRITE_ENABLED</key>
            <value>true</value>
        </entry>
    </DynamicProperties>
    
  • 检查MQ队列权限
    确认目标MQ队列未设置ALTERQ(DISABLED),且发送用户拥有修改MQMD字段的权限(需具备+ALTER权限)。

  • 验证MQ客户端兼容性
    确保TIBCO BWCE使用的IBM MQ客户端版本与目标MQ服务器版本匹配,旧版本客户端可能存在MQMD字段支持限制。

内容的提问来源于stack exchange,提问作者JMSMQ

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.11 18:05:09