how to consumer this MQRFH2 message - ibm-mq

We want to upgrade MQ but we don't have the source code, the sender is generating a message MQRFH2 but no parameters are displayed
But we also need to get the file name from message

Related

Identifying message type from active MQ console

Is it possible to identify what message type was used by the producer, something like
session.createTextMessage(...)
by looking at the Active MQ console and opening a message in the "Pending Messages" list?
I see Type, but that is left blank.
The Type field on that page maps the JMSType in the JMS Message. If you set the JMSType on your message for routing or other purposes it will be shown on that page.

Selectors for content based routing in WMQ where the payload has a namespace

This question is related to Websphere MQ. I have a requirement where in I have to route messages based on the content of the message.
I know about the concept of selectors in WMQ subscriptions and I have also been successful in doing this based on the Message Headers (using MQRFH2 )
I now need to filter messages based on the payload which are XMLNSC and have a valid namespace associated with it.
Eg:
<?xml version="1.0" encoding="UTF-8"?>
<ns0:test xmlns:ns0="abc.com/is/2009/schemas/envelope/">
<flag>Y</flag>
</ns0:test>
If I have to accept messages if the flag is 'Y' only, then how do I set the selector in my subscriptions?
Please let me know.
Thanks in advance.
Any WebSphere MQ selection information must either be in the message header or a message property. WMQ is tuned to move messages as far downstream as possible, as quickly as possible, and does not do anything with message payloads other than to deliver them. Any functionality based on data in the message body requires one of IBM's ESB solutions such as IIB, or else to write code to inspect the payload and take the appropriate action.
If at all possible, the application creating the messages should place the selection field into a message property. If that isn't possible, a program can intercept the message, evaluate the payload and set the property, then re-queue the message.

JMS Body content filter [duplicate]

I m implementing Pub/Sub model using JMS. I send a message from Pub to all Subscribers. I want that subscribers should get filtered messages based on some string in actual message body.
For example a subscriber subscribe to a topic 'sports' and should receive only those posts which has keyword 'cricket' in it in the message text body.
p.s. I dont want to use message selectors.
How can I implement this.
Thanks and Regards.
Take a look at apache camel. It provides a means of routing and filtering messages and has excellent integration with Active MQ.
You can use no mechanism for filtering messages on a topic based on the Message Body contents. Usually a JMS Selector is used for filtering messages but even this does not work for Body Contents:
From The Java EE 6 Tutorial:
A
message selector cannot select messages on the basis of the content of the message body..
The issue here is that you have to first receive (that is consume) the message and then extract its contents which precludes the case of any kind of Body filtering.
You cannot do that with JMS itself.
What you typically do is to make the sending application use different queues depending on message type (orders, customer prospects, invoices, status reports or whatnot). If you don't want to use separate queues, you can at least make the sending application mark the message with some property that you can filter on using a selector.
In some cases, where you still need to do routing and/or filtering based on the actual content of a message, there are tailor made software for that kind of thing. Apache Camel and Mule ESB are two options.

Filtering in JMS based on body content

I m implementing Pub/Sub model using JMS. I send a message from Pub to all Subscribers. I want that subscribers should get filtered messages based on some string in actual message body.
For example a subscriber subscribe to a topic 'sports' and should receive only those posts which has keyword 'cricket' in it in the message text body.
p.s. I dont want to use message selectors.
How can I implement this.
Thanks and Regards.
Take a look at apache camel. It provides a means of routing and filtering messages and has excellent integration with Active MQ.
You can use no mechanism for filtering messages on a topic based on the Message Body contents. Usually a JMS Selector is used for filtering messages but even this does not work for Body Contents:
From The Java EE 6 Tutorial:
A
message selector cannot select messages on the basis of the content of the message body..
The issue here is that you have to first receive (that is consume) the message and then extract its contents which precludes the case of any kind of Body filtering.
You cannot do that with JMS itself.
What you typically do is to make the sending application use different queues depending on message type (orders, customer prospects, invoices, status reports or whatnot). If you don't want to use separate queues, you can at least make the sending application mark the message with some property that you can filter on using a selector.
In some cases, where you still need to do routing and/or filtering based on the actual content of a message, there are tailor made software for that kind of thing. Apache Camel and Mule ESB are two options.

HL7 2.X Standard Ackknowledgement

I am trying to write an HL7 message parser that will send a specified acknowledgment back to a messaging engine so that my applicaiton may receive the next message in line.
The interface engine that is sending the messages is call VISTA (has anyone ever worked with it?) I have been told that it expects to receive an 'Ackknowledgement ACK' if there is a value in MSH field 15. In all of the messages that I am currently receiving, I am getting a value of 'AL'.
I have basically set up my application to send a TCP message to a hostname/ip:portnumber that can be set before the applicaiton is started.
If possible, could someone provide a sample ACK message (without sensitive data of course) AND the non-whitspace characters that wrap the message?
I would like to make sure that I know what I need to send back to the sending application.
After some further research of my own, and the help of responses to this post, I have found that the following items are required to be included for the sending applicaiton to accept my ACK and move onto the next message.
The ACK must contain the following:
MSH|^~\&|Receiving App|Receiving App ID|Sending App|Sending App ID|DateTime of Message||"ACK"|Message Control ID|Processing ID|Version ID
MSA|AE <or> AR <or> AA|Message Control ID (MSH 9 from the sent message)
ERR| This particular segment is not required by the sending application
The problem I was experiencing pertained to my Sending and Receiving App IDs and Names were swapped.
Thanks for the help!
I haven't worked with VISTA, and my only current setup is returning an error ACK due to some application issue that I won't be able to debug right now, but in case it's helpful here's the error ACK:
MSH|^~\&|||||20100630130105.496-0500||ACK|20||2.3
MSA|AE|H20091222063637.9834
ERR|^^^207&Application Internal Error&HL70357
Note that this is HL7 v2.3 - the format may be different for other versions.

Resources