C Managing Message Sequencing

This appendix provides information about the command-line and Java-based tools provided by Oracle SOA Suite for healthcare integration to monitor and manage message sequencing. You can use these functions in custom clients.

C.1 Overview of Sequenced Message Management

Messages processed through Oracle SOA Suite for healthcare integration are sequenced through the B2B sequence manager. The message sequencing information is stored in the B2B_SEQUENCE_MANAGER database table in order to preserve the correct order of messages. At times, the process of sequencing messages needs to be managed. For example, if a message in an endpoint becomes stacked and cannot be processed, it can block all other messages for that endpoint from being processed. In this case, manual intervention is needed in order to remove or resubmit the message and restart sequencing.

Using the tools provided with Oracle SOA Suite for healthcare integration to monitor and manage message sequencing, you can do the following:

View all endpoints along with their current state

View messages by state, endpoint, or a combination of both

Discard messages by state, endpoint, message ID, or state and endpoint

C.2.1 Listing Endpoints With States

You can generate a report that lists the messages that are pending in the sequence table with a specific state and for a specific endpoint. The resulting report includes the message IDs and the corresponding state for each.

C.2.2 Listing Pending Sequenced Messages

You can generate a report of pending sequenced messages based on the state and endpoint of the messages, based solely on the state, or based solely on the endpoint. This command lists the messages that are pending in the sequence table based on the options you specify. The resulting report includes the message IDs and the corresponding state for each. There are four methods you can use to list sequenced messages, depending on the criteria you want to use.

The name (or IP address and port number) for the endpoint for which you want to list messages.

C.2.3 Discarding Messages

You can delete sequenced messages from the B2B_SEQUENCE_MANAGER table based on the following criteria combinations:

State and endpoint of the messages

State of the messages

Endpoint of the messages

Endpoint direction (for endpoint pairs with both inbound and outbound)

Message ID

First message only for an endpoint

The discard methods let you manage the messages in the B2B_SEQUENCE_MANAGER table. This is useful in cases where a message is stacked and is blocking other messages from being processed or when there is an issue with a specific message that means it should not be processed sequentially.

Note:

Discarding messages from the sequence manager table does not delete any of the business messages.

The name (or IP address and port number) for the endpoint associated with the messages to delete.

state

The state of the messages to delete. Specify one of the following states:

PROCESSED: Message processing is complete and is pending for delivery.

STACKED: An error has occurred preventing the message from processing.

PAUSED: The endpoint is paused.

direction

The direction of the messages in the endpoint pair for which you want to discard messages. Specify INBOUND or OUTBOUND. Only use this option if you are deleting messages for one direction of an endpoint pair.

The name (or IP address and port number) of the endpoint for which you want to discard messages.

direction

The direction of the messages in the endpoint pair for which you want to discard messages. Specify INBOUND or OUTBOUND. Only use this option if you are deleting messages for one direction of an endpoint pair.

C.2.5 Pausing and Resuming and Endpoint

There may be times when sequence message processing needs to be paused for a specific endpoint, such as when an external system fails. In this case, the endpoint can be paused until the system is restored. Once the system is restored, you can resume processing for the endpoint. For endpoint pairs, you can pause or resume the endpoint for both inbound and outbound, only for inbound, or only for outbound.

The name (or IP address and port number) for the endpoint you want to resume

direction

The direction of the messages in the endpoint pair you want to resume. Specify INBOUND or OUTBOUND. Only use this option if you are resuming one direction of an endpoint pair.

C.3 Command-Line Tools for Managing Sequenced Messages

The command-line tools are run using Apache ant. These tools are for administrator use only. No security or permission checks are performed to prevent the logged-in user from viewing or discarding data.

C.3.1 Prerequisites for Running Command-Line Tools

Before you can run the command-line tools, you need to make sure your environment is configured correctly. Do the following before running any commands:

After running any command-line tool, restart the healthcare integration user interface or B2B Console. This is because the interfaces cache some metadata and any command-line action that updated the metadata could lead to invalid cached data.

All of the command-line tools can be run without any JNDI credentials. To restrict the command-line tools from anonymous use, enter the following information in the jndi.properties file:

C.3.2 Listing Endpoints With States

You can generate a report that lists all the endpoints and their respective states to help you determine the health of each endpoint.

The syntax of this command is:

ant -f ant-hcfp-util.xml hcfpsequencemanager -Dmode=listTargets

Option

Description

-Dmode

The mode in which to run the command. For this purpose, set this option to listTargets.

C.3.3 Listing Pending Sequenced Messages

You can generate a report of pending sequenced messages based on the state and endpoint of the messages, based solely on the state, or based solely on the endpoint. This command lists the messages that are pending in the sequence table based on the options you specify. The resulting report includes the message IDs and the corresponding state for each.

C.3.4 Discarding Messages

You can delete sequenced messages from the SEQUENCE_MANAGER database table based on the following criteria combinations:

State and endpoint of the messages

State of the messages

Endpoint of the messages

Message ID

First message only for an endpoint

Discard mode lets you manage the messages in the B2B_SEQUENCE_MANAGER table. This is useful in cases where a message is stacked and is blocking other messages from being processed or when there is an issue with a specific message that means it should not be processed sequentially.

Note:

Discarding messages from the sequence manager table does not delete any of the business messages.

The mode in which to run the command. For discarding messages, set this option to discard. If you are discarding only the first message in an endpoint, set this option to discardFirst and only specify the endpoint.

-Dstate

The state of the messages to discard. Specify one of the following states:

PROCESSED: Message processing is complete and is pending for delivery.

STACKED: An error has occurred preventing the message from processing.

PAUSED: The endpoint is paused.

To discard messages of all states, do not use this option when running the command.

-Dendpoint

The name (or IP address and port number) of the endpoint for which you want to list messages. To discard messages for all targets, do not use this option when running the command.

-Dmsgid

The message ID of a specific message to delete. When you use this option, you only need to specify the mode and not the target or state.

Example C-4 Discarding Sequenced Messages Based on State and Endpoint

This example deletes all messages from the sequence manager for the Pharmacy01 endpoint with a state of PROCESSED.

C.3.6 Pausing and Resuming an Endpoint

There may be times when sequence message processing needs to be paused for a specific endpoint, such as when an external system fails. In this case, the endpoint can be paused until the system is restored. Once the system is restored, you can resume processing for the endpoint.