cancel
Showing results for 
Search instead for 
Did you mean: 

Can I Use JAVA mapping to handle Empty payload in case of timeout error

Former Member
0 Kudos

Hi Exports

This is synchronous call from R/3

Request flow R3 ECC 4.7 RMCA  (RFC Call) - > RFC Adaptor ->  XI - > Request Mapping  -> JMS adaptor -> MQ -> Third Party application

Response Flow  Third Party application - >MQ - > JMS adaptor  -> XI ->Response Mapping - > RFC Adaptor ->R/3 .

JMS correlation = Message id is use in the scenario

Main RFC Request Messages goes into the time out  error if the response JMS message (Matching JMS response with Msg REq  ID) is not found after 3 min.

Parameter is default

Xiadapter . inbound . timeout . default  == 180000.

Along with this "Response message Mapping"  is called and this give error (There is no payload in timeout error message )com.sap.aii.utilxi.misc.api.BaseRuntimeException: Parsing an empty source. Root element expected! at com.sap.aii.mappingtool.tf3.Transformer.checkParserException(Transformer.java(Inlined Compiled Code)) at com.sap.aii.mappingtool.tf3.Transformer.start(Transformer.java(Compiled Code)) at com.sap.aii.mappingtool.tf3.AMappingProgram.execute(AMappingProgram.java

Can I Use JAVA mapping before response message maping is called to handle Empty payload in case of timeout error

Accepted Solutions (1)

Accepted Solutions (1)

Shabarish_Nair
Active Contributor
0 Kudos

Can I Use JAVA mapping before response message maping is called to handle Empty payload in case of timeout error

>>>

If due to a time out you get an empty payload currently and it fails in the mapping, i dont see any reason as to why you can use a java mapping to handle this. Even if the java mapping tries to execute and finds a null payload it might go into an exception and as long as you can handle the exception, you should be able to control the flow.

Answers (5)

Answers (5)

Former Member
0 Kudos

Why dont you use XML validation here.

In case the XML strucuture is not correct( which covers empty message as well) send a default message with a customized error meeage to the source.

How to do it?

Well as mentioned you have three minutes to timeout, using a BPM in the desing is not a bad idea. In response mapping add first mapping as a java which has an exception handling step to catch the empty message, here you can create the output meeage with a custom error message.

baskar_gopalakrishnan2
Active Contributor
0 Kudos

In addition to Shabarish's reply....

Use Java mapping to retrieve the payload content and if you see the content is null then logic will be written to handle the situation at the catch block. Handle the normal flow logic using try block and write the response output accordingly. Similarly if the exception is thrown and caught in the catch block , write the response output accordingly and handle this situation. Since we need output of one mapping as the source of other mapping program, keep java mapping program as the initial mapping program to handle this.

You might look at this sample code to handle timeout

http://www.javacoffeebreak.com/articles/network_timeouts/

Former Member
0 Kudos

incase of timeout, do you want to send empty messaege to the source?

if yes, there are two thing whcih you need to take care here

1) first try to increase the timeout limit (if possible), more importantly try to find out why 3rd part application is taking more than 3 minutes to Process a message?

2) Since you have designed your interafce as a synch interafce, so anyway if the message crosses defined time limit, it will fail in PI ( this for the very reason of synch nature). So if the interface cannot be redesigned as 2 async interface then i guess.. u can give it a try speaking with 3rd party team if they can send a blank message  be  message processing takes more than 3 minutes.

Former Member
0 Kudos

the problem seems to be that due to timeout occurring, system is trying to do response mapping even there is no response message.

so the interface should be redesigned from sync to async scenario replacing RFC by proxy, so that there be no scenario of timeout error.

if the current solution will only stay, then either increase the timeout property from 3 min to some large value, or to ask JMS system team to optimize the request processing on their side.

as far as this timeout error handing for empty msg payload through java mapping in this scenario is concerned, sorry it does not seem feasible as all mappings will fail due to this time out error leading to empty payload msg,  so you will have to go with above options.

rajasekhar_reddy14
Active Contributor
0 Kudos

if there is no input paylaod then obviously JAVA mapping throws error. bit difficult to handle empty payloads in JAVA mapping.