Start of Content Area

Function documentation Synchronous Messages  Locate the document in its SAP Library structure

Use

Synchronous messages have the quality of service Best Effort. On the one hand, the application must ensure that there are no duplicate messages or data losses. On the other hand, the application receives error messages. Best Effort also means that no transactional concepts are involved.

Features

     If an adapter receives a synchronous XI message, it must either send a synchronous response message or, if an error has occurred, an exception. If a technical error occurs, the adapter can also send an exception. The Adapter Framework messaging service converts the exception to a SystemError message and sends it to the Integration Server.

Note

Synchronous response message: Open XIAdapterCategories.java and search for the character string CS_SYNCRESP.

Application error: Open CCIInteraction.java and search for the character string CS_SYNCAPPERR.

     If an adapter forwards a synchronous message to the Adapter Framework messaging service, the response message is sent back to the adapter along the same path, but in the opposite direction.

Activities

     If you are using the default module ModuleProcessorExitBean to call the JCA adapter, the module uses XIInteractionSpec to specify the synchronous message transfer. In this case, set the function name for XIInteractionSpec to XIInteractionSpec.CALL.

If an adapter receives such an XIInteractionSpec, it must return an instantiated and filled XIMessageRecord (in the case of a successful response message or an application error) in the XIInteractionSpec.execute() call or, if an error occurs, XIDeliveryException or XIRecoverableException.

     If you are not using the default module ModuleProcessorExitBean, you can define your own communication models for the adapter implementation to replace the CCI InteractionSpec.

However, the last of your own modules must return a response message to the calling module processor, as specified in the example below.

     The following methods are available to enable you to read error information in the form of an ErrorInfo object from the message, or to set the error information in a message.

     Message.getErrorInfo()

     Message.setErrorInfo()

You can read or set the following ErrorInfo attributes:

Name

Description

ErrorCode

Application error code

ErrorArea

Contains the adapter namespace and the adapter type

ErrorCategory

Must be set to Application

AdditionalErrorText

Text for the application error

ApplicationFaultInterface

Specifies in the Integration Repository the interface that processes the application error messages

ApplicationFaultInterfaceNamespace

Namespace of the interface

The following methods are available for reading and setting the attributes:

     ErrorInfo.setAttribute()

     ErrorInfo.getAttribute()

     ErrorInfo.getSupportedAttributeNames()

Example

try {

  myRespMsg = myAdapter.call(myReqMsg);

  if (myRespMsg != null)   //synchronous

      moduleData.setPrincipalData((Object) myRespMsg.getXIMessage());

  else                     // asynchronous

      moduleData.setPrincipalData(null);

 

catch(Exception e) {

{

  //Assumption: All errors are temporary

  TRACE.catching(SIGNATURE, e);

  RecoverableException re = new RecoverableException(xre);

  ModuleException me = new ModuleException("Temporary error: Adapter call failed. Reason: "  + e.getMessage(), e);

  TRACE.throwing(SIGNATURE, me);

  throw me;

}

 

End of Content Area