Event handling

For event notification, the connector detects events written to a queue by an application rather than a database trigger. An event occurs when an application or other MQ-capable software generates FIX messages and stores them on the MQ message queue.

Retrieval

The connector uses the pollForEvents() method to poll the MQ queue at regular intervals for messages. When the connector finds a message, it retrieves it from the MQ queue and examines it to determine its format. If the format has been defined in the connector's static object, the connector passes both the message body and a new instance of the business object associated with the format to the configured data handler; the data handler is expected to populate the business object and specify a verb. If the format is not defined in the static meta-object, the connector passes only the message body to the data handler; the data handler is expected to determine, create and populate the correct business object for the message. See Error handling for event failure scenarios.

The connector processes messages by first opening a transactional session to the input queue. This transactional approach allows for a small chance that a business object could be delivered to an integration broker twice due to the connector successfully submitting the business object but failing to commit the transaction in the queue. To avoid this problem, the connector moves all messages to an in-progress queue. There, the message is held until processing is complete. If the connector shuts down unexpectedly during processing, the message remains in the in-progress queue instead of being reinstated to the original input queue.

Note:
Transactional sessions with a JMS service provider require that every requested action on a queue be performed and committed before events are removed from the queue. Accordingly, when the connector retrieves a message from the queue, it does not commit to the retrieval until three things occur: 1) The message has been converted to a business object; 2) the business object is delivered to the integration broker, and 3) a return value is received.

Synchronous event handling

Optionally, to support applications that want feedback on the requests they issue through WebSphere MQ, the connector for FIX Protocol issues report messages back to the applications detailing the outcome of their requests once they have been processed.

To achieve this, the connector posts the business data for such requests synchronously to the integration broker. If the business object is successfully processed, the connector sends a report back to the requestor including the return code from the integration broker and any business object changes. If the business object cannot be processed, the connector sends a report containing the appropriate error code and error message.

In either case, an application that sends a request to the connector for FIX Protocol is notified of its outcome.

Processing

If the connector for FIX Protocol receives any messages requesting positive or negative acknowledgement reports (PAN or NAN), it posts the content of the message synchronously to the integration broker and then incorporates the return code and modified business data into a report message that is sent back to the requesting application.

Table 1 shows the required structure of FIX messages that are received and processed synchronously by the connector.

Table 1. Required structure of synchronous WebSphere MQ messages

MQMD field Description Supported values (multiple values should be OR'd)
MessageType
 
Message Type DATAGRAM
report
 
Options for report message requested

You can specify one or both of the following:

  • MQRO_PAN The connector sends a report message if the business object could be successfully processed.
  • MQRO_NANThe connector sends a report message if an error occurred while processing the business object.

You can specify one of the following to control how the correlation ID of the report message is to be set:

  • MQRO_COPY_MSG_ID_TO_CORREL_IDThe connector copies the message ID of the request message to the correlation ID of the report. This is the default action.
  • MQRO_PASS_CORREL_IDThe connector copies the correlation ID of the request message to the correlation ID of the report.

ReplyToQueue
 
Name of reply queue The name of the queue to which the report message should be sent.
replyToQueue
 Manager
 
Name of queue manager The name of the queue manager to which the report message should be sent.
Message Body
 

A serialized business object in a format compatible with the data handler configured for the connector.

Upon receipt of a message as described in Table 1, an ICS-based connector does the following:

  1. Reconstructs the business object in the message body using the configured data handler.
  2. Looks up the collaboration name specified for the business object and verb in the static metadata object.
  3. Posts the business object synchronously to the specified collaboration.
  4. Generates a report encapsulating the result of the processing and any business object changes or error messages.
  5. Sends the report to the queue specified in the replyToQueue and replyToQueueManager fields of the request.

Table 2 shows the structure of the report that is sent back to the requestor from the connector.

Table 2. Structure of the report returned to the requestor

MQMD field Description Supported values (multiple values should be OR'd)
MessageType
 
Message Type
REPORT
 
feedback
 
Type of report One of the following:
  • MQRO_PAN If the business object is processed successfully.
  • MQRO_NANIf the connector or the integration broker encountered an error while processing the request.
Message Body
 

If the business object is successfully processed, the connector populates the message body with the business object returned by the integration broker. This default behavior can be overridden by setting the DoNotReportBusObj property to true in the static metadata object. If the request could not be processed, the connector will populate the message body with the error message generated by the connector or the integration broker.

Recovery

Upon initialization, the connector checks the in-progress queue for messages that have not been completely processed, presumably due to a connector shutdown. The connector configuration property InDoubtEvents allows you to specify one of four options for handling recovery of such messages: fail on startup, reprocess, ignore, or log error.

Fail on startup

With the fail on startup option, if the connector finds messages in the in-progress queue during initialization, it logs an error and immediately shuts down. It is the responsibility of the user or system administrator to examine the message and take appropriate action, either to delete these messages entirely or move them to a different queue.

Reprocess

With the reprocessing option, if the connector finds any messages in the in-progress queue during initialization, it processes these messages first during subsequent polls. When all messages in the in-progress queue have been processed, the connector begins processing messages from the input queue.

Ignore

With the ignore option, if the connector finds any messages in the in-progress queue during initialization, the connector ignores them, but does not shut down.

Log error

With the log error option, if the connector finds any messages in the in-progress queue during initialization, it logs an error but does not shut down.

Archiving

If the connector property ArchiveQueue is specified and identifies a valid queue, the connector places copies of all successfully processed messages in the archive queue. If ArchiveQueue is undefined, messages are discarded after processing. For more information on archiving unsubscribed or erroneous messages, see Error handling.

Note:
By JMS conventions, a retrieved message cannot be issued immediately to another queue. To enable archiving and re-delivery of messages, the connector first produces a second message that duplicates the body and the header (as applicable) of the original. To avoid conflicts with the JMS service provider, only JMS-required fields are duplicated. Accordingly, the format field is the only additional message property that is copied for messages that are archived or re-delivered.

Copyright IBM Corp. 1997, 2003