cancel
Showing results for 
Search instead for 
Did you mean: 

Extract info from RFH2 header in MQ message

former_member245887
Participant
0 Kudos

Hi All,

I'm trying to send a MQ message with RFH header. Purpose is that JMS adapter extracts user data from RFH Header.

A few questions:

1.Format RFH2 header:

-In the MQMD I assign the format: MQFMT_RF_HEADER_2

-Apart from the mandatory fields in the RFH2 header I write user data to it as well and it looks like this:

<usr><msgType dt="string">data</msgType></usr> Is this sufficient or should there be an additional surrounding tag like <MQRFH2>?

2.In PI, I use a JMS Adapter. On the Module-tab I have added AF_Modules/DynamicConfigurationBean (type: Local Enterprise Bean, Module Key: RFHHEADER), after ConvertBinaryToXMBMessage and before CallSapAdapter.

Under Module Configuration I added 2 entries:

RFHHEADER key.0 read http://sap.com/xi/XI/System/JMS DCJMSMessageProperty0

RFHHEADER value.0 msgType

I want to extract the value of msgType and use it.

On the Parameter-tab, I suppose I have to add Adapter-specific message attributes, but it is not exactly clear what I should put there.

3.Dynamic Configuration Bean

Is there anything I should do to activate that Dynamic Configuration Bean, because when I sent I message, I don't see anything in the monitor of the processed XML messages, not even an error.

Kind Regards

Edmond Paulussen

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member245887
Participant
0 Kudos

Hi,

I solved the problem myself.

1. No surrounding tag like <MQRFH2> is required.

2. Under Module configuration you don't have to enter anything.

Instead go to Parameters -> Advanced, mark "Specify Additional JMS Message Properties and add entries in the table below. e.g. in my case I added 1 parameter with name=MsgType

Furthermore go to Parameters -> Processing. In the field JMS Message Selector enter MsgType='example', the value that the RFH2 header should contain for processing the message by this channel.

Kind Regards

Edmond

Former Member
0 Kudos

Hi Edmond - thanks for your solution.

Can you take it a step further? Let's say you have 2 RFH2 parameters p1 & p2 coming into PI, and you want to map these p1 & p2 fields to an inbound mapping on the receiver side. Presumably these p1 & p2 get stored to DCJMSMessageProperty0 & DCJMSMessageProperty1.  Not sure in this case if you would still use the 'JMS Message Selector' entry.  I would think not. How do you then get at these values, for example how exactly can these be used in any subsequent mappings - need to use udf? xslt? or... Exactly how do these p1 & p2 fields get to be available in any esr mapping?
I am currently on PI 7.1 but how about even for 7.11 or even 7.0?

Thanks,
Keith

former_member245887
Participant
0 Kudos

Hi Keith,

We've never tried the scenario you describe, but I think it must be possible.

In our case we have several PI Comm. channels listening on 1 MQSeries queue. If a message appears on the queue then the PI comm. channel for which the MsgType in the RFH Header matches the value specified in 'JMS Message Selector' reads the message. We do not forward the value of any parameter to a message mapping. We just use it send different message type over 1 mqseries queue and then to the right PI comm channel, receiver determination etc.

If you want to use the parameter(s) further on then,I suppose, you have to leave JMS Message Selector empty.

I cannot help you with your question on how to have the fields available in any mapping. But I think it is independent of the use of RFH2 header. You will have to search how to pass variables form the comm.channel to a mapping.

Edmond

Former Member
0 Kudos

Thanks for your response - I understand your scenario now and good to know for any of my future work.

For my scenario I will keep looking - nothing specific found so far.

Keith

stefan_grube
Active Contributor
0 Kudos

>

> Hi All,

>

> I'm trying to send a MQ message with RFH header. Purpose is that JMS adapter extracts user data from RFH Header.

>

> A few questions:

> 1.Format RFH2 header:

> -In the MQMD I assign the format: MQFMT_RF_HEADER_2

> -Apart from the mandatory fields in the RFH2 header I write user data to it as well and it looks like this:

> <usr><msgType dt="string">data</msgType></usr>

> On the Parameter-tab, I suppose I have to add Adapter-specific message attributes, but it is not exactly clear what I should put there.

The list of additional parameters are stored in the ASMA field.

So you enter here the header value "msgType" with type String

The value "data" is stored in DCJMSMessageProperty0

You do not need the DynamicConfigurationBean in this scenario.