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 WebSphere MQ messages and stores them on the MQ message queue.
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 meta-object, the connector uses the data handler to generate an appropriate business object with a verb. 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 a collaboration 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.
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. For more information on archiving unsubscribed or erroneous messages, see "Error handling".