2

I was using Flume to send messages from HDFS to IBM MQ Queue. But now we are trying Nifi to do so. Everything is working fine except the message format is different. The message format I am getting on the Queue end is in MQHRF2. I need to change it to MQSRT format. Is there a way to do that in PublishJMS or should I use some other processor in Nifi before PublishJMS to make it happen?

PublishJMS is sending the XML headers with message attributes and at the end "the-message". I only need message to be sent to the queue not the headers. I think this is somewhat related to the message formats mentioned above or am I wrong?

trougc
  • 329
  • 3
  • 14
  • The answers to this question should help: [How to remove RFH2 header for a JMS client](https://stackoverflow.com/questions/37186558/how-to-remove-rfh2-header-for-a-jms-client/37672734#37672734) – JoshMc May 11 '18 at 17:47
  • @JoshMc Thanks for guiding me in the correct direction. – trougc May 14 '18 at 14:13

1 Answers1

2

Changing the Destination Name in Nifi PublishJMS to snippet below worked for me

queue:///theQueueName?targetClient=1

Thanks @JoshMC for guiding me in the correct direction.

trougc
  • 329
  • 3
  • 14
  • Nice self-answer, this will be a good reference for users of Nifi in the future. I was personally not sure how you would specify the value to Nifi as I have never used it. As a MQ admin I thought a way that would work with Nifi would be covered in the post I linked to in the comment since it shows many different ways to specify the value with JMS based applications. – JoshMc May 14 '18 at 17:32
  • @JoshMc I added the above snippet and it took care of the header, but the format of the Message is blank. It is not "MQSTR " which I wanted. Do you have any idea how can I do that? Problem is occurring when a third application tries to read the same message from the queue that I pushed to the queue. REASON CODE: 2110 – trougc May 15 '18 at 14:48
  • Are you setting the message type to JMSText? This should map to the MQMD Format of MQSTR. – JoshMc May 15 '18 at 15:07
  • @JoshMc I am not sure where to specify message type in Nifi. I am using PublishJMS processor. I tried but it is giving me error. – trougc May 15 '18 at 17:39
  • @JoshMc I just saw that the PublishJMS version we are using is the old one which will only send JMS Byte Messages. Bummer! – trougc May 15 '18 at 20:57
  • Sorry I don't know much about Nifi, I'm a MQ admin so am familiar with the underlying MQ but not Nifi itself. – JoshMc May 15 '18 at 21:24
  • Does Nifi run as part of Spring? – JoshMc May 15 '18 at 21:25
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/171165/discussion-between-trougc-and-joshmc). – trougc May 16 '18 at 14:19