是否有 MQ/XMS 等同于 MQ/JMS setTargetClient

Is there an MQ/XMS equivalent for the MQ/JMS setTargetClient

我有一个正在运行的 XMS 发布应用程序,但它包含 JMS headers 作为消息的一部分。我的订阅应用程序实际上是一个 python 应用程序,我想知道是否可以从 XMS 应用程序中删除 JMS headers。我知道这在 JMS 中是可能的,但在 C#/XMS 中是否可能。

我的 C# 代码相当简单(省略了一些细节 -

            // Get an instance of factory.
            factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);

            // Create WMQ Connection Factory.
            cf = factoryFactory.CreateConnectionFactory();

            // Set the properties
            cf.SetStringProperty(XMSC.WMQ_HOST_NAME, conn.host);
            ...

            // Create connection.
            connectionWMQ = cf.CreateConnection();

            // Create session
            sessionWMQ = connectionWMQ.CreateSession(false, AcknowledgeMode.AutoAcknowledge);

            // Create destination
            destination = sessionWMQ.CreateTopic(conn.topic_name);

            // Create producer
            producer = sessionWMQ.CreateProducer(destination);

            // Start the connection to receive messages.
            connectionWMQ.Start();

            // Create a text message and send it.
            textMessage = sessionWMQ.CreateTextMessage();
            textMessage.Text = xmsJson.toJsonString();
            producer.Send(textMessage);

在 MQ/JMS 中,我可以使用 setTargetClient 删除 JMS headers -


  private void setToNoJMSHeaders(Destination destination) {
    try {
        MQDestination mqDestination = (MQDestination) destination;
        mqDestination.setTargetClient(WMQConstants.WMQ_CLIENT_NONJMS_MQ);
    } catch (JMSException jmsex) {
      logger.warning("Unable to set target destination to non JMS");
    }
  }

我想知道我是否可以对 XMS 中的主题目标执行相同的操作

            // Create destination
            destination = sessionWMQ.CreateTopic(conn.topic_name);
            // Configure the destination to Non-JMS
            ... ???

是的,你应该可以做到这一点

尝试

// Create destination
       destination = sessionWMQ.CreateTopic(conn.topic_name);
       destination.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ);

参见:https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.1.0/com.ibm.mq.ref.dev.doc/prx_wmq_target_client.htm