Search code examples
jmsibm-mqapache-nifi

PublishJMS processor fails while publishing json message to IBM Websphere MQ


I am facing an issue in PublishJMS processor of NIFI while pushing the json message from it.

Note: Just to add tried various processors to see if the attributes can be modified, but none helped, I am able to figure out the issue is only because I am using ConsumeJMS & PublishJMS together in the same flow.

JSON Message to be published:

{"dataprepcomplete":{"modelfamilytype":"property","groupid":"1","claims":[{"requestid":"1","claimid":"10001"},{"requestid":"2","claimid":"10002"}]}}

The issue of the "JMSCC0051: THE PROPERTY 'JMS_IBM_REPORT_PASS_CORREL_ID' SHOULD SET USING TYPE 'JAVA.LANG.INTEGER', NOT 'JAVA.LANG.STRING'" is resolved as per the solution posted in my earlier post and I am able to publish json messages to my MQ Queue from the below flow.

QueryDatabaseTable > ConvertAvroToJSON > PublishJMS

But I am getting the same error as reported in the earlier post from the PublishJMS processor when I am using the PublishJMS is the below mentioned flow.

ConsumeJMS > ReplaceText > PublishJMS

Am I missing anything?

Do I have to plug some other processor before the PublishJMS to be able to publish the message successfully.?

Any help on this will be highly appreciated.

Below are properties for the procesors.

ConsumeJMS properties: enter image description here

ReplaceText properties enter image description here

PublishJMS properties enter image description here

DataProvenance of PublishJMS processor enter image description here enter image description here enter image description here


Solution

  • Thanks @andrew you are correct. But I would like to put the exact fix I did to make it working and to overcome the issue of IBM Websphere MQ jars v7.5 and below.

    I had to make sure I delete the below mentioned attributes from the Flowfile of Apache Nifi using the UpdateAttribute processor.

    JMS_IBM_MsgType, JMS_IBM_Encoding & JMS_IBM_PutApplType

    And also to substitute the same attributes as integer in the Flowfile by adding the additional attributes with same name.

    Attached are the screenshot of the UpdateAttribute processors which made it working.

    enter image description hereenter image description hereenter image description here

    Hope it helps as it is a work around till the actual issue is fixed with Apache NIFI.