0

We want to extract information from ApplIdentityData on MQ Header. But on the consumer side, we dont see corresponding JMS header for ApplIdentityData. I did trace on the logs and i dont find any information related to ApplIdentityData.

I am using Apache Camel to read the MQ and process the Queue Message. In the camel trace logs, i dont find anything to ApplIdentityData. Could you please help me ?

Below is the MQ Message Header and Camel File :

    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'

Camel File:

            <!-- 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 -->
JoshMc
  • 10,239
  • 2
  • 19
  • 38
Badri S
  • 1
  • 6
  • Can you provide you camel config for how you have attempted to retreive the message ApplIdentityData value? – JoshMc Dec 08 '17 at 04:17
  • attached my Camel File ...Below is the part where i have enable MQMD,but still not getting respective JMS value on consumer – Badri S Dec 08 '17 at 07:18
  • Try with ``, if that works I'll write up a quick answer for you to accept. – JoshMc Dec 08 '17 at 08:17
  • @JoshMc ,I tried with the mentioned property : Error - ]: Could not resolve placeholder 'jms.queue' in string value "${jms.queue}"; nested exception is java.lang.IllegalArgumentException: Could not resolve placeholder 'jms.queue' in string value "${jms.queue}" Error -Invalid property 'mdReadEnabled' of bean class [com.ibm.mq.jms.MQQueue – Badri S Dec 11 '17 at 13:52
  • Take a look at this post "[Apache Camel — Websphere MQ integration](https://stackoverflow.com/questions/45992345/apache-camel-websphere-mq-integration)" – JoshMc Dec 11 '17 at 15:37
  • Did you get this to work? – JoshMc Dec 12 '17 at 17:58
  • @JoshMc, i went through the post. Since the JAVA code is provided by vendor,i dont have privilege to check the code. I have access to Camel Config file and i am trying to achieve this for JMS_IBM_MQMD_ApplIdentityData which is STRING. is there a way to get this header via CamelConfig ? – Badri S Dec 14 '17 at 14:06
  • I am not a Camel export. I have added the [apache-camel] tag to your question, hopefully someone that knows more about Camel can help you. – JoshMc Dec 14 '17 at 16:32
  • still looking for options to solve this issue :( – Badri S Jan 12 '18 at 08:03

1 Answers1

0

Take a look at these two Knowledge Center pages which will tell you how to do it:

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q032330_.htm

https://www.ibm.com/support/knowledgecenter/en/SSFKSJ_9.0.0/com.ibm.mq.dev.doc/q032350_.htm

Essentially you have to configure the JMS Destination with the property "WMQ_MQMD_READ_ENABLED" set to true before receiving the message. You can then query the property, "JMS_IBM_MQMD_ApplIdentityData" on the received message.

a_cornish_pasty
  • 816
  • 4
  • 10