Managed callout programming model

You can use the managed callout programming model to send outbound messages from IMS™ applications to request services or data from an external message-driven bean (MDB) and receive response data synchronously or asynchronously to the same IMS application in the same transaction.

MDBs are stateless, server-side Java™ EE components that can be configured as listeners on a Java Connector Architecture (JCA) 1.5 resource adapter for handling inbound messages coming from an enterprise information system (EIS). An MDB is an EJB component that can be activated by message delivery to consume and process messages.

In the JCA 1.5 specification, MDBs are commonly referred to as message endpoints or simply endpoints. The key benefits of MDBs include a clearer separation of message handling and business processing, and a wider reuse of the business processing by other incoming messages.

Because this programming model takes advantage of the JCA 1.5 standards, the IMS TM resource adapter can manage the callout protocol and the correlation of the response to the appropriate request for you. As a result, the managed callout programming model is preferred over the non-managed callout programming model for its ease of use, cleaner code, greater reuse, and better scalability.

The following diagram shows how a synchronous callout message is processed by an MDB.

Figure 1. Processing a synchronous callout message from IMS by using a message-driven bean
This diagram shows the message flow for processing synchronous callout messages by using a message-driven bean.

The following diagram shows how an asynchronous callout message is processed by an MDB.

Figure 2. Processing an asynchronous callout message from IMS by using a message-driven bean
This diagram shows the message flow for processing asynchronous callout messages by using a message-driven bean.
In the MDB callout programming model, the MDB must implement:
  • The com.ibm.j2ca.base.ExtendedInboundListener interface
  • The onMessage() method for receiving synchronous callout requests
  • The onNotification() method for receiving asynchronous callout request messages

These methods are invoked by the IMS TM resource adapter when a message comes in for the particular MDB, depending on whether the callout message is asynchronous or synchronous. The IMS TM resource adapter automatically handles the callout protocol. For synchronous callout messages, the IMS TM resource adapter also handles the passing of the correlation token.

Start of changeBegin figure description. IMS TM Resource Adapter Version 14.1.0 or later. In IMS TM Resource Adapter Version 14 and later, you can enable the send-only-with-acknowledgment protocol. Using this protocol, IMS TM Resource Adapter receives an acknowledgment from IMS when IMS receives a synchronous callout response message. In Version 13 and earlier, this acknowledgment is unavailable.End of change

Start of changeBegin figure description. IMS TM Resource Adapter Version 14.1.0 or later. In IMS TM Resource Adapter Version 14 and later, you can enable connection pooling for synchronous callout messages that are sent back to IMS. In Version 13 and earlier, the IMS TM Resource Adapter must create and then discard a new connection whenever a callout response is sent. By enabling connection pooling, you can avoid the overhead of opening and closing multiple connections. End of change