Message Exchange Patterns

AS4 includes Message Exchange Patterns (MEP). An MEP defines how you can exchange messages between two trading partners.

AS4 supports the following ebMS MEPs for both the sender and the receiver:

  • One-Way/Push: Sends a user message to a trading partner.
  • One-Way/Pull: Sends a pull signal to a trading partner to receive a user message.
  • Two-Way/Sync: Synchronously exchanges messages between two trading partners.
  • Two-Way/PushPull: Pushes a request user message to a trading partner and uses a pull signal to receive a reply user message.
  • Two-Way/PushPush: Asynchronously exchanges messages between two trading partners.

One-Way/Push MEP

The One-Way/Push MEP sends (push) a user message to a trading partner. The user message is carried over a one-way or a two-way underlying protocol.

Step Description
1 The initiating MSH sends the data packaged as a user message to the responding MSH.
2 The responding MSH receives and processes the user message.

One-Way/Pull MEP

The One-Way/Pull MEP sends a pull signal to a trading partner to receive a user message. The initiating MSH sends a pull signal message to the responding MSH, as illustrated in the following diagram:

Step Description
1 The initiating MSH sends a pull signal message to the responding MSH.
2 The responding MSH sends the message data packaged as a user message to the initiating MSH.
3 The initiating MSH receives the user message for processing.

In One-Way/Pull, AS4 plays the role of initiating MSH or responding MSH. The role played by the MSH depends on whether you want to send or receive a user message.

Selective-Pull

Selective pull feature allows to pull a subset of messages posted on Message Partition Channels (MPC). The initiating Messaging Service Handler (MSH) sends a pull signal to the responding MSH along with a pull criteria using requestSM. The responding MSH uses requestSM parameters to match the messages present in the MPC and sends back the first matching message as a response using requestUM. A Selective pull mechanism is initiated by a business application by providing simple selection item or complex selection item parameters in the service.

Simple selection, complex selection or both are used to pull messages from an MPC.

Following are the two types of selection:

  • Simple selection: Use this option to select messages using any of the following parameters: RefToMessageId, ConversationId, AgreementRef, Service, and Action.
  • Complex selection: Use this option to select messages using any of the following parameters: From, To, and MessageProperties.

AS4 acting as Initiating MSH

When you want AS4 to play the role of initiating MSH, IBM webMethods B2B uses the mpc and pmodeId input parameters that are passed to constructSubmitInput service to fetch the appropriate TPA and identify the messaging parameters for the transfer.

The parameters specified in the requestSM leg of the TPA are used to generate the pull signal and identify the address of the responding MSH. When the user message is received as a response to the pull signal, IBM webMethods B2B uses the requestUM leg of the TPA to process the user message.

AS4 acting as Responding MSH

In One-Way/Pull MEP, use the constructSubmitInput service to package the submitted payload(s) as a user message and submit it to an MPC. The service uses the values of the ReceiverID, ReceiverIDType, SenderID, SenderIDType, and pmodeID. If pmodeID is empty, then a tuple of ReceiverID, toRole, SenderID, fromRole, service, action, and agreementRef input parameters to retrieve the appropriate TPA. The values in the TPA are then used to identify the messaging parameters. Instead of transferring the message to the initiating MSH, the IBM webMethods B2B stores the message in the MPC specified in the legs/businessInfo/mpc TPA parameter of the requestUM leg.

When a pull signal is received, AS4 determines which TPA to use to process the pull signal by matching the MPC named in the pull signal with the MPC named in the requestSM leg of each TPA that is configured in IBM webMethods B2B. The matching MPC is used to process the pull signal. AS4 retrieves the user message from the MPC specified in the pull signal and sends it to the initiating MSH. If no MPC is specified in the pull signal, AS4 uses the default MPC to pull the user message.

AS4 uses the IBM webMethods B2B database as the MPC queue. When a user message is queued, the message is stored in IBM webMethods B2B with a UserStatus of QUEUED, and the corresponding bizDocId is cached. When a pull signal is received, the module first retrieves the bizDocId from the cache First In - First Out, and then retrieves the user message that corresponds to this bizDocId from IBM webMethods B2B. The retrieved message is then sent to the initiating MSH.

IMPORTANT When purging the transaction analysis in IBM webMethods B2B, do not delete user messages in the QUEUED state.

Two-Way/Sync MEP

The Two-Way/Sync MEP synchronously exchanges messages between two trading partners. The initiating MSH sends a user message as a request to the responding MSH. The responding MSH replies with a user message to the initiating MSH.

Step Description
1 The initiating MSH sends a user message as a request to the responding MSH.
2 The responding MSH sends a user message as a reply.

In Two-Way/Sync, AS4 plays the role of initiating or responding MSH. The role played by the MSH depends whether you want to send a user message as a request or reply.

AS4 acting as Initiating MSH

When you want AS4 to play the role of initiating MSH, the Two-Way/Sync transfer is initiated by IBM webMethods B2B.

The parameters specified in the requestUM leg of the TPA are used to generate the user message and identify the address of the responding MSH. After IBM webMethods B2B receives a reply, it uses the replyUM leg of the TPA to process the user message.

If IBM webMethods B2B does not receive a response within the time-period defined in AS4 configuration, an error message is generated by the initiating MSH.

AS4 acting as Responding MSH

When you want AS4 to play the role of responding MSH, use the constructSubmitInput service to submit a reply user message to the corresponding request user message by setting sync flag to true. The refToMessageId of the reply user message should be set to the request user message's MessageId value. AS4 uses the requestUM leg of the TPA to process the request user message and sends the reply to the initiating MSH.

Two-Way/PushPull MEP

The Two-Way/PushPull MEP sends (pushes) a request user message to a trading partner followed by a pull signal to receive a reply user message as shown in the diagram. Both the user message and the pull signal are sent by the initiating MSH.

The pulled user message refers to the user message that was pushed.

Step Description
1 The initiating MSH sends a user message to the responding MSH.
2 The initiating MSH sends a pull signal to the responding MSH.
3 A user message is submitted at the responding MSH as a response to the request user message.

Two-Way/PushPush MEP

The Two-Way/PushPush MEP asynchronously exchanges messages between two trading partners. The initiating MSH sends a user message as a request to the responding MSH. The responding MSH replies with a user message to the initiating MSH.

The reply must refer to the request.

Step Description
1 The initiating MSH sends a user message as a request to the responding MSH.
2 The responding MSH sends a user message as a reply.

In Two-Way/PushPush, AS4 plays the role of an initiating or a responding MSH. The role played by MSH depends on whether you want to send a user message as a request or reply.