How to set ApplicationIdData using MQQueueConnectionFactory?

后端 未结 1 654
难免孤独
难免孤独 2021-01-27 04:07

Trying to figure out the camel/Spring configuration to set ApplicationIdData using JMS.

I know the java way to do it as below, I set MQOO_SET_IDENTITY_CONTEXT using bel

1条回答
  •  忘掉有多难
    2021-01-27 04:51

    All I needed to find a way in camel config to set some properties in the destination and set some header. I set destination in the header as

    queue:///Q_Name?targetClient=1&mdWri‌​teEnabled=true&a‌​mp;mdMessageContext=‌​1

    Note: Setting mdWri‌​teEnabled=true is equal to

     // Enable MQMD write
      dest.setBooleanProperty(WMQConstants.WMQ_MQMD_WRITE_ENABLED, true);
    

    Setting mdMessageContext=‌​1 is equal to

    // Optionally, set a message context if applicable for this MD field
      dest.setIntProperty(WMQConstants.WMQ_MQMD_MESSAGE_CONTEXT, 
        WMQConstants.WMQ_MDCTX_SET_IDENTITY_CONTEXT);
    

    Then set ApplicationIdData as BSI_XML_CANADA_ACK BSI_XML_CANADA_ACK

    Complete code:

    
                
                 queue:///Q_Name?targetClient=1&mdWriteEnabled=true&mdMessageContext=1 
                  true 
                  2  
                
                    APP_ID_NAME
                
                
                    APP_ID_NAME
                  
                
    

    I am not sure that JMS_IBM_MQMD_ApplOriginData is required.

    0 讨论(0)
提交回复
热议问题