Skip to Content
0

Get MessageID in Receiver REST Channel

Dec 13, 2016 at 09:07 PM

247

avatar image
Former Member

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.

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Dec 15, 2016 at 03:49 PM
0

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.

Show 2 Share
10 |10000 characters needed characters left characters exceeded

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

3
Former Member
Vadim Klimov

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

1
Harish Mistri Dec 13, 2016 at 11:20 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded
avatar image
Former Member Dec 15, 2016 at 02:00 PM
0

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

Share
10 |10000 characters needed characters left characters exceeded