PublishJMS processor fails while publishing json message to IBM Websphere MQ

廉价感情. 提交于 2021-02-10 17:44:15

问题


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:

ReplaceText properties

PublishJMS properties

DataProvenance of PublishJMS processor


回答1:


Try deleting all attributes starting with JMS before sending. Use UpdateAttribute with a regex mask for that.




回答2:


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.

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



来源:https://stackoverflow.com/questions/43245201/publishjms-processor-fails-while-publishing-json-message-to-ibm-websphere-mq

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!