• No results found

Message Sequencing

In document Oracle Fusion Middleware (Page 122-126)

Task 5 Configure Security 1 Click the Security tab.

2. Provide security parameters, as described in Table 5–6, depending on the channel/transport protocols selected in Task 1.

5.5.2 Message Sequencing

Exchanging messages in sequence can be challenging in a multi-threaded system, because the first message produced may not necessarily arrive at the destination first. For enterprises with this business requirement, Oracle B2B provides a sequencer and a dispatcher. The sequencer sequences a message based on arrival time. The dispatcher dispatches the sequenced message. Message sequencing is available for outbound and inbound directions.

Protocols supported for message sequencing include MLLP Exchange (TCP transport) and Generic Exchange (FILE, FTP, SFTP, JMS, AQ, and HTTP transports).

Notes: Even though it works for all documents, message sequencing is certified only for EDI, HL7, and Custom document protocols. Sequencing is not supported for transient mode MLLP connections. EDI batching is not supported for message sequencing. If sequencing is enabled on messages as part of BATCH, it can lead to errors and not all messages are processed. Do not use EDI batching on the messages that are sequenced.

FunctionalAck (FA) and Acknowledgement (ACK/MDN) are not sequenced.

Sequencing does not support the Delivery Channel retry feature. Use the Auto Stack Handler in the Sequencing feature to retry delivery of failed document delivery attempts rather than the retry setting in delivery channel. When documents are sequenced, the delivery channel used for the documents should avoid the use of retry settings.

Configuring Channels

5.5.2.1 Outbound Message Sequencing

Outbound Message Sequencing for AQ and JMS Delivery Channels

To enable sequencing for an outbound message, for AQ and JMS delivery channels, enqueue the message by setting the ACTION_NAME property to

TARGET:sequence_target_name as shown in Example 5–1.

However, when using the ENQUEUE utility that is provided with the b2b.jar, set

eventName (not ACTION_NAME) to TARGET:sequence_target_name; for example,

eventName=TARGET:sequence1.

To enable sequencing when using the default channel, use b2b.sequencingTarget = sequence_target_name.

When using a self written AQ Enqueue utility, the AQ Header to be used is

ACTION_NAME. eventName is to be used when using the B2B provided Enqueue utility in b2b.jar.

Example 5–1 Outbound Message Sequencing for AQ and JMS Delivery Channels

ACTION_NAME = TARGET:sequence_target_name

Outbound Message Sequencing for FTP and SFTP Delivery Channels

To enable FTP/SFTP sequencing selecting only the sequencing flag in the delivery channel configuration does not work. You must also configure an FTP listening channel with following parameters:

Sequencing

TimeStamp Format TimeStamp Offset TimeStamp Source

For example the following are sample values for the parameters: Sequencing: true

TimeStamp Format: 43,55,'MMM d yyyy' TimeStamp Offset: +0000

TimeStamp Source: MMM dd yyyy

Note that, if sequencing is enabled, the order in which files are copied to the folder is the order in which they are processed. If a large payload is copied, the partner must wait until the large payload copy is complete. Then the sender may send the next file, as sequencing is based on the last-modified-timestamp on the file.

Outbound Message Sequencing for HTTP Delivery Channels

Post the message in b2b/sequenceReceiver, and add an additional HTTP header

TARGET:sequence_target_name, otherwise the IP address is used as the sequence target.

The messages enqueued with the above header will be sequenced based on the specified sequence target for the transport protocols such as FTP, SFTP, JMS, AQ and HTTP/HTTPS. The enqueued messages with this header would be processed by Oracle B2B, and based on the enqueue time, the messages are sequentially delivered to the trading partner.

Configuring Channels

To dispatch the sequenced message, configure the Outbound Dispatcher Count parameter, shown in Figure 5–22.

Figure 5–22 Dispatcher Configuration: Administration > Configuration Tab

The image shows Miscellaneous (continued) configuration parameters: Generic Message Type (default value set to false), Outbound Dispatcher Count (default value set to 0), Inbound Dispatcher Count (default value set to 0), Auto Stack Handler (default value set to false), and Auto Stack Handler Interval (default value set to 1) *********************************************************************************************** By default, the value is 0, which is the setting for sequencing without dispatching (stacking). Depending on the message load, set Outbound Dispatcher Count to the appropriate value.

Sequencing in Burst Mode

For sequencing with AQ and JMS, the Oracle B2B server might not be polling while messages get added into the queue. When Oracle B2B begins polling, several messages are available in a burst mode and Oracle B2B cannot maintain the sequence under normal conditions. To ensure sequence in burst mode, the following is recommended: For AQ, along with the TARGET:target_name property, add the flag for

B2B_SEQUENCE_TIMESTAMP with timestamp as the value. For example:

TARGET:targetname;B2B_SEQUENCE_TIMESTAMP:1284371552121

In this example, 1284371552121 is the time in milliseconds (in Java).

For JMS, a new header can be added as B2B_SEQUENCE_TIMESTAMP with value as the time in milliseconds.

5.5.2.2 Inbound Message Sequencing

Inbound message sequencing is enabled as part of the delivery channel configuration. The incoming messages received by these delivery channels are processed by Oracle B2B and delivered in a sequenced manner based on the inbound time.

To enable sequencing for an inbound message, enable the Sequence property for the delivery channel, as shown in Figure 5–23.

Configuring Channels

Figure 5–23 Sequencer Configuration

The image shows the Transport Protocol Parameters tab, with the following channel details: Connection Mode (value is Server), Host Name (value is localhost), Port, Permanent Connection (selected), Sequence (selected), Polling Interval (value is 10), and Timeout (value is 300).

*********************************************************************************************** To dispatch the sequenced message, configure the Inbound Dispatcher Count parameter, as shown in Figure 5–22.

For AQ and JMS, in the case of inbound messages received from a partner, if there is a header TARGET (similar to how outbound message sequencing is enabled), then the same value is used and inbound messages are sequenced on the given target. For HTTP inbound message sequencing, Oracle B2B exposes a URI,

/b2b/sequenceReceiver, and requests arriving at this endpoint are processed sequentially. If you want to use multiple sequence targets, you can provide them by adding an HTTP header SEQUENCE_TARGET to the request.

To add SEQUENCE_TARGET as a header to an outbound HTTP message, use the Additional transport headers parameter in the delivery channel. See Table 5–3 for more information.

If the incoming message's HTTP headers contains SEQUENCE_TARGET as a header, then the value of this is used as the sequence target. If SEQUENCE_TARGET is not available and there is a FROM HTTP header, then that is used as the sequence target. If

FROM HTTP header does not exist, then B2B will use the IP address from which the message originated as the Sequence Target. The originating IP address of the HTTP request is treated as the Sequence Target by default.

5.5.2.3 Sequencing Without Dispatching

Trading partner downtime is typically handled by stacking messages in the back-end application, which requires the entire message processing in B2B after the downtime. This leads to under-utilizing the B2B application during downtime and overloading when the trading partner comes up. This affects the regular message flow, because there is a surge in message processing.

When the auto stack handler is used, then Oracle B2B retries the outbound failed message in sequence. Once the endpoint is up for delivery, all messages in the sequence will be eligible for delivery, and this may cause an overload of message delivery at the endpoint. To reduce the outflow, set the

b2b.OutboundDispatchInterval property, which sets the interval between dispatch of messages in milliseconds.

Configuring Channels

Upon trading partner delivery failure, the corresponding messages are marked not to be picked up by the dispatcher, resulting in stacking the messages in B2B instead of the back-end application. To process the messages, set the following properties:

Auto Stack Handler = true

Auto Stack Handler Interval = interval (in seconds)

The Auto Stack Handler and Auto Stack Handler Interval parameters are shown in Figure 5–22. When set to true, the stacked message are eligible for delivery by the dispatcher during an appropriate interval. It is also possible to specify the variable interval with a comma-separated value to Auto Stack Handler Interval.

5.5.2.4 Troubleshooting Message Sequencing

B2B Becomes Non-Responsive

If B2B becomes non-responsive after running thousands of messages as part of outbound sequenced messages, check the number of dispatchers. The recommended maximum number of dispatchers is 5.

Sequenced Message Failure

If the failure of a sequenced message is due to ■ Agreement not found

■ Validation errors which can be fixed by updating the ECS file. You can recover the failed message by the following options: 1. Inbound case: resubmit the wire message.

In document Oracle Fusion Middleware (Page 122-126)