cancel
Showing results for 
Search instead for 
Did you mean: 

Get MessageID in Receiver REST Channel

HarshC
Active Participant

I'd like to pass the PI "message id" to the receiver system via a receiver REST channel as a parameter on the Rest URL.

I'm trying to follow the documentation, but unable to make it work.

Has someone tried to do this before?

I'd like to avoid using a map in this interface and accomplish this via channel config.

Accepted Solutions (1)

Accepted Solutions (1)

HarshC
Active Participant
0 Kudos

We achieved this by using DynamicConfigBean on the sender side to set the MessageID to a variable in the REST namespace(http:// sap.com/xi/XI/System/REST).

No mapping was required.

The part that confused me initially was, I assumed that the REST receiver channel can read any variable from Dynamic Config.

That statement is partially true. REST channel can read any variable from Dynamic Config, as long as it is in the REST namespace.

vadimklimov
Active Contributor

Hi Harsh,

Take caution when you use message ID produced by sender adapter, when sending message and referring to this message ID in the receiver channel - not always they are going to be same message IDs. In majority of cases, when the message is targeted to only one receiver and its interface, they are same IDs since message remains the same. But for example, if there is message split (multiple receivers / interfaces determined during routing step) or BPM in between, message IDs for the message generated by sender channel, and the message produced by receiver channel, will be different.

Hence, it shall be more consistent to use message ID of the message that reaches receiver communication channel - and for this, to either use user-defined function / function library and populate corresponding attribute within mapping, or, if mapping capabilities cannot be utilized, make use of adapter module DynamicConfigurationBean placed in receiver channel.

Regards,

Vadim

HarshC
Active Participant

Hi Vadim,

Thanks for the comment. You bring up a good point and I will keep this in mind.

In the current requirement, we are looking for a unique key to send to a partner, so I think any message ID would do.

However, since you brought this up, maybe you can answer a follow up question 🙂

I can find documentation on how SOAP adapter uses MessageID's to guarantee QOS(EO).

Link: https://help.sap.com/saphelp_nw75/helpdata/en/5e/164442c1a1c353e10000000a1550b0/content.htm

I'm unable to find similar documentation about REST. Do you know how REST adapter deals with QOS?

Thanks,

Harsh

Answers (2)

Answers (2)

HarshC
Active Participant
0 Kudos

Hi Harish,

Thanks for your response. As I mentioned, I'd like to avoid using a map.

Is there a way to accomplish this via channel config?

Thanks,

Harsh

Harish
Active Contributor
0 Kudos

Hi Harsh,

You can build the URL with message id in message mapping, and set the dynamic configuration using UDF.

https://blogs.sap.com/2014/12/18/pi-rest-adapter-defining-a-dynamic-endpoint/

https://blogs.sap.com/2014/12/18/pi-rest-adapter-using-dynamic-attributes/

regards,

Harish