For event notification, the connector detects an event written to a queue by an application rather than by a database trigger. when messages are stored them in the WebSphere MQ queue.
The connector uses a polling method to poll the WebSphere MQ input queue at regular intervals for messages. When the connector finds a message, it retrieves it from the WebSphere MQ input queue and examines it to determine its format. If the format has been defined in the connector's static or child meta-objects, the connector uses the data handler to generate an appropriate business object with a verb.
The connector processes messages by first opening a transactional session to the WebSphere MQ queue. This transactional approach allows for a small chance that a business object could be delivered to a business process 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 WebSphere MQ queue.
To support applications that require feedback on the requests they issue, the connector for healthcare can issue report messages 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 requesting application including the return code from the integration broker and any business object changes. If the connector or the integration broker fails to process the business object, 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 Healthcare is notified of its outcome.
If the connector for healthcare receives any messages requesting positive or negative acknowledgment 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 in to a report message that is sent back to the requesting application.
Table 1 shows the required structure of messages sent to the connector to be processed synchronously.
Table 1. Required structure of synchronous WebSphere MQ messages
MQMD Field (message descriptor) |
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:
You can specify one of the following to control how the correlation ID of the report message is to be set:
|
ReplyToQueue | Name of reply queue | The name of the queue to which the report message should be sent. |
ReplyToQueueManager | 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, the connector:
Table 2 shows the structure of the report that is sent to the requesting application from the connector.
Table 2. Structure of the report returned to the requesting application
MQMD field | Description | Supported values (multiple values should be OR'd) |
---|---|---|
MessageType | Message type | REPORT |
feedback | Type of report |
One of the following:
|
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 meta-data object. If the request could not be processed, the connector populates the message body with the error message generated by the connector or the integration broker. |
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.
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.
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.
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.
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.
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.