Skip Headers
Oracle® Application Server Adapters for Files, FTP, Databases, and Enterprise Messaging User's Guide
10g Release 3 (10.1.3.1.0)

Part Number B28994-02
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

6 Oracle Application Server Adapter for Native MQSeries

This chapter describes how to use the Oracle Application Server Adapter for MQSeries (MQSeries adapter), which works in conjunction with Oracle BPEL Process Manager and Oracle Enterprise Service Bus as an external service. It contains the following sections:

6.1 MQSeries Message Queuing Concepts

Message queuing is a technique for asynchronous program-to-program communication. It enables application integration by allowing independent applications on a distributed system to communicate with each other. One application sends messages to a queue owned by a queue manager, and another application retrieves the messages from the queue. The communication between applications is maintained even if the applications are running at different times or are temporarily unavailable.

The following list explains the basic concepts of message queuing:

6.1.1 MQSeries Concepts

Messaging and Queuing Series (MQSeries) is a set of products and standards developed by IBM. MQSeries provides a queuing infrastructure that provides guaranteed message delivery, security, and priority-based messaging.

The communication process between an MQSeries application and a MQSeries server is shown in Figure 6-3. An MQSeries client enables an application to connect to a queue manager on a remote machine.

Figure 6-3 The MQSeries Communication Process

Description of Figure 6-3 follows
Description of "Figure 6-3 The MQSeries Communication Process"

Every queue in MQSeries belongs to a queue manager. A queue manager has a unique name and provides messaging and queuing services to applications through a Message Queue Interface (MQI) channel. A queue manager also provides access to the queues created on it and transfers messages to other queue managers through message channels.

In MQSeries, data is sent in the form of messages. The sending application constructs a message and sends it to a queue by using the API calls. The message remains in the queue until the receiving application is ready to receive it. The receiving application gets the messages from the queue by using the API calls.

For sending messages to a remote queue, the remote queue definition must be defined locally. The remote queue definition consists of the destination queue name and the transmission queue name.

Figure 6-4 displays message structure of an MQSeries message.

Figure 6-4 MQSeries Message

Description of Figure 6-4 follows
Description of "Figure 6-4 MQSeries Message"

An MQSeries message consists of following parts, as shown in Figure 6-4:

  • Message Header

    The message header contains information such as, unique message ID, message type, message priority, and routing information. Every MQSeries message must have a message header.

  • Optional Header

    The optional header is required for communication with specific applications, such as CICS application.

  • Application Data

    The actual data. For example, a record from an indexed or flat file or a row or column from a DB2 table.

6.2 Introduction to Native MQSeries Adapter

Oracle BPEL Process Manager and Oracle Enterprise Service Bus include the MQSeries adapter. The MQSeries adapter enables applications to connect to MQSeries queue managers and place MQSeries messages on queues or to remove MQSeries messages from queues.

This section contains the following sections:

6.2.1 The Need for MQSeries Adapter

The MQSeries adapter provides all native MQSeries functionalities. Although you can configure the Oracle Application Server Adapter for Java Message Service (JMS adapter) with MQSeries provider, it provides only the JMS functionalities provided by MQSeries and not the native MQSeries functionalities. The following list explains the advantages of MQSeries adapter over the JMS adapter for MQSeries:

  • The MQSeries adapter supports Positive Action Notification (PAN)/Negative Action Notification (NAN).

  • The MQSeries adapter supports report messages such as, confirmation on delivery, confirmation on arrival, exception report, and expiry report.

  • The MQSeries adapter supports sending unwanted or corrupted message to a dead-letter queue.

  • The MQSeries adapter provides advanced filter options, such as filtering message belonging to a group.

  • The MQSeries adapter is faster and easier to use.

6.2.2 MQSeries Adapter Integration with Oracle BPEL Process Manager

The MQSeries adapter is automatically integrated with Oracle BPEL Process Manager. When you create a partner link or a MQ adapter service in Oracle JDeveloper, the Adapter Configuration Wizard is started.

This wizard enables you to select and configure the MQSeries adapter or other OracleAS Adapters, as shown in Figure 1-3. The Adapter Configuration Wizard then prompts you to enter a service name, as shown in Figure 1-4. When configuration is complete, a WSDL file of the same name is created in theApplications Navigator section of Oracle JDeveloper. This WSDL file contains the configuration information you specify with the Adapter Configuration Wizard.

The Operations window of the Adapter Configuration Wizard prompts you to select an operation to perform. Based on your selection, different Adapter Configuration Wizard windows appear and prompt you for configuration information.

Table 6-1 lists the available operations and provides references to sections that describe the information about these operations.

6.2.3 MQSeries Adapter Integration with Oracle Enterprise Service Bus

The MQSeries adapter is automatically integrated with Oracle Enterprise Service Bus. When you create an MQ adapter service in JDeveloper ESB Designer, the Adapter Configuration Wizard is started as shown in Figure 1-2.

This wizard enables you to select and configure the MQSeries adapter. When configuration is complete, a WSDL file of the same name is created in the Applications Navigator section of Oracle JDeveloper. This WSDL file contains the configuration information you specify with the Adapter Configuration Wizard.

The Operations window of the Adapter Configuration Wizard prompts you to select an operation to perform. Based on your selection, different Adapter Configuration Wizard windows appear and prompt you for configuration information. Table 6-2 lists the available operations and provides references to sections that describe the configuration information you must provide.

Table 6-2 Supported Operations for Oracle Enterprise Service Bus

Operation See Section...

Enqueue Message

Section 6.3.1.1, "Enqueue Message"


Dequeue Message

Section 6.3.1.2, "Dequeue Message"


Request-Response

Section 6.3.1.6, "Request-Response Synchronous (Oracle Enterprise Service Bus as Server)"



6.3 MQSeries Adapter Concepts

This section explains the following concepts of the MQSeries adapter:

6.3.1 Messaging Scenarios

The MQSeries adapter supports the following messaging scenarios:

Note:

The MQSeries adapter does not support XA transactions.

6.3.1.1 Enqueue Message

In this scenario, the MQSeries adapter connects to a specific queue managed by a queue manager and then writes the message to the queue. For outbound messages sent from Oracle BPEL Process Manager or Oracle Enterprise Service Bus, the MQSeries adapter performs the following operations:

  1. Receives message from Oracle BPEL Process Manager or Oracle Enterprise Service Bus.

  2. Formats the XML content as specified at the design time.

  3. Sets the properties of the message such as, priority, expiry, message type, and persistence. These properties are based on the selections that you made in the Adapter Configuration wizard.

    For information on message properties, see Section 6.3.2.1, "Messages Types".

  4. Sends the message to the queue specified at design time in the Adapter Configuration wizard.

Figure 6-5 displays the operation type that you need to select in the Adapter Configuration wizard window.

Figure 6-5 Adapter Configuration Wizard: Produce Message Selection

Description of Figure 6-5 follows
Description of "Figure 6-5 Adapter Configuration Wizard: Produce Message Selection"

The window that appears after selecting the Put Message into MQ operation type is shown in Figure 6-6.

Figure 6-6 Put Message Options

Description of Figure 6-6 follows
Description of "Figure 6-6 Put Message Options"

You can specify the following properties in this window:

  • Queue Name: The name of the queue on which the MQSeries adapter will enqueue the message. This is a mandatory field.

  • Queue Manager: The name of the queue manager to which the queue belongs. This field is optional and should be used when enqueuing message to a remote queue.

  • Message Format: The format of the message.

    Note:

    When enqueuing a message, ensure that the various mandatory values, required for a specific format, are specified correctly.
  • Priority: The priority of the message ranging from 0 (low) to 9 (high).

  • Persistence: The persistence of the message. You can also specify the persistence of the message to be taken from the default priority attribute, as defined by the destination queue.

  • Expiry: The expiry time of the message. The message is discarded after the expiry time has elapsed.

Refer to Section 6.3.2, "Message Properties" for detailed information about these properties.

The next Adapter Configuration Wizard window that appears is the Messages window shown in Figure 6-7. This window enables you to select the XML Schema Definition (XSD) file for translation.

Figure 6-7 Messages Window

Description of Figure 6-7 follows
Description of "Figure 6-7 Messages Window"

If native format translation is not required (for example, a JPG or GIF image is being processed), select the Native format translation is not required check box. The file is passed through in base-64 encoding.

XSD files are required for translation. If you want to define a new schema or convert an existing data type description (DTD) or COBOL Copybook, then select Define Schema for Native Format. This starts the Native Format Builder Wizard. This wizard guides you through the creation of a native schema file from file formats, such as comma-separated value (CSV), fixed-length, DTD, and COBOL Copybook. After the native schema file is created, you are returned to this Messages window with the Schema File URL and Schema Element fields filled in. See Section 7.1, "Creating Native Schema Files with the Native Format Builder Wizard" for more information.

Note:

Ensure that the schema you specify includes a namespace. If your schema does not have a namespace, an error message appears.

6.3.1.2 Dequeue Message

In this scenario, the MQSeries adapter connects to a specific queue managed by a queue manager and then removes the message from the queue. For inbound messages sent to Oracle BPEL Process Manager or Oracle Enterprise Service Bus, the MQSeries adapter performs the following operations:

  1. Connects to the queue specified at the design time.

  2. Dequeues the message from the queue when a message arrives.

  3. Reads and translates the message based on the translation logic defined at design time.

  4. Publishes the message as XML message to Oracle BPEL Process Manager or Oracle Enterprise Service Bus.

    Figure 6-8 displays the operation type that you need to select in the Adapter Configuration wizard.

    Figure 6-8 Adapter Configuration Wizard: Consume Message Selection

    Description of Figure 6-8 follows
    Description of "Figure 6-8 Adapter Configuration Wizard: Consume Message Selection"

    The window that appears after selecting the Get Message into MQ operation type is shown in Figure 6-6.

    Figure 6-9 Get Message From MQ window

    Description of Figure 6-9 follows
    Description of "Figure 6-9 Get Message From MQ window"

    You can specify the following properties in this window:

    • Queue Name: The name of the queue from which the MQSeries adapter will dequeue the message. This is a mandatory field.

    • Queue Manager: The name of the queue manager to which the queue belongs. This field is optional.

    The next Adapter Configuration Wizard window that appears is the Messages window shown in Figure 6-7. This window enables you to select the XSD schema file for translation.

    As with specifying the schema for the produce message operation, you can perform the following tasks in this window:

    • Specify if native format translation is not required

    • Select the XSD schema file for translation

    • Start the Native Format Builder Wizard to create an XSD file from file formats such as CSV, fixed-length, DTD, and COBOL Copybook

    See Section 6.3.1.1, "Enqueue Message" for more information about the Messages window.

6.3.1.3 Request-Response (Oracle BPEL Process Manager as a Client)

In this scenario, the Oracle BPEL Process Manager sends a request message and receives the corresponding response using a non-initiating receive activity. The invoke activity initiates the outbound invocation of the adapter to send the request. The MQSeries adapter performs the following operations:

  1. Receives message from Oracle BPEL Process Manager.

  2. Formats the XML content as specified at the design time in the Adapter Configuration wizard.

  3. Sets properties and a correlation schema on the request message.

  4. Sends the message to the queue specified at the design time. The third-party application receives the message, processes it, generates the response, and then enqueus the response message to the replyTo queue specified in the request message. The Correlation ID and Message ID of the response message is generated on the basis of the correlation schema specified in the request message.

  5. The MQSeries adapter dequeues the message from the queue.

  6. Sends the response to the non-initiating receive activity of the BPEL process. To ensure that response is sent to correct BPEL instance, correlation schemas are used.

Figure 6-10 shows a sample BPEL process for this scenario.

Figure 6-10 Oracle BPEL Process Manager as Client Sample

Description of Figure 6-10 follows
Description of "Figure 6-10 Oracle BPEL Process Manager as Client Sample"

Figure 6-11 displays the operation type that you need to select in the Adapter Configuration wizard.

Figure 6-11 Selecting an Operation Type

Description of Figure 6-11 follows
Description of "Figure 6-11 Selecting an Operation Type"

The window that appears after selecting the Send Message to MQ and Get Reply/Reports operation type is shown in Figure 6-12.

Figure 6-12 Send Message to MQ and Get Reply/Reports Window

Description of Figure 6-12 follows
Description of "Figure 6-12 Send Message to MQ and Get Reply/Reports Window"

You can specify the following properties in this window:

  • Message Type: The type of the message. You can send a normal message or a request message.

  • Get Reports: Select this option if you want any kind of report. You can specify the type of report in the next window shown in Figure 6-13.

  • Queue Name: The name of the queue to which the MQSeries adapter enqueues the message. This is a mandatory field.

  • Queue Manager: The name of the queue manager to which the queue belongs. This field is optional.

  • Message Format: The format of the message.

  • Priority: The priority of the message ranging from 0 (low) to 9 (high).

  • Persistence: The persistence of the message.

  • Expiry: The expiry time of the message. The message is discarded after the expiry time has elapsed.

Refer to Section 6.3.2, "Message Properties" and Section 6.3.5, "Report Messages" for more information about these properties.

The window that is displayed when you click Next in the Send Message to MQ and Get Reply/Reports window can be a Reports window (shown in Figure 6-13) or a Response window (shown in Figure 6-13).

The Reports window shown in Figure 6-13 is displayed only if you have selected the Get Reports option in the Send Message to MQ and Get Reply/Reports window shown in Figure 6-12.

Figure 6-13 Reports Window

Description of Figure 6-13 follows
Description of "Figure 6-13 Reports Window"

You can select the following types of reports in this window:

  • Confirmation on Arrival

  • Confirmation on Delivery

  • Exception Report

  • Expiry Report

Refer to Section 6.3.5, "Report Messages" for information about these report types.

The Response window shown in Figure 6-14 is displayed when you click Next in the Reports window.

Figure 6-14 Response Window

Description of Figure 6-14 follows
Description of "Figure 6-14 Response Window"

You can specify the following properties in the Response window:

  • Queue Name: The name of the queue to which the response should be sent. This is a mandatory field.

  • Queue Manager: The name of the queue manager to which the queue belongs. This field is optional.

  • Correlation Schema: The correlation schema that should be used by the MQSeries adapter. For information about correlation schemas, refer toSection 6.3.3, "Correlation Schemas" .

When you click Next in the Response window, a Messages window shown in Figure 6-15 is displayed. This window enables you to select the XSD schema file for translation for request as well as response message.

Figure 6-15 Messages Window

Description of Figure 6-15 follows
Description of "Figure 6-15 Messages Window"

You can perform the following tasks in this window:

  • Specify if native format translation is not required

  • Select the XSD schema file for translation

  • Start the Native Format Builder Wizard to create an XSD file from file formats such as CSV, fixed-length, DTD, and COBOL Copybook

See Section 6.3.1.1, "Enqueue Message" for more information about the Messages window.

6.3.1.4 Synchronous Request-Response (Oracle BPEL Process Manager as Server)

In this scenario, the Oracle BPEL Process Manager receives a request, processes it, and sends the response synchronously by using a reply activity. The MQSeries adapter performs the following operations:

  1. Dequeues the request message from the queue when the message arrives.

  2. Reads and translates the message based on the translation logic defined at design time.

  3. Publishes the message as XML message to Oracle BPEL Process Manager. The Oracle BPEL Process Manager processes the request and sends the response to the MQSeries adapter.

  4. Receives the response message from the Oracle BPEL Process Manager.

  5. Formats the XML content as specified at the design time.

  6. Sets the properties of the message such as priority, expiry, message type, and persistence. These properties are based on the selections that you made in the Adapter Configuration wizard.

  7. Sends the message to the queue specified at design time in the Adapter Configuration wizard.

Figure 6-16 shows a sample BPEL process for this scenario.

Figure 6-16 Synchronous Request-Response Oracle BPEL Process Manager as Server sample

Description of Figure 6-16 follows
Description of "Figure 6-16 Synchronous Request-Response Oracle BPEL Process Manager as Server sample"

Figure 6-17 displays the operation type that you need to select in the Adapter Configuration wizard.

Figure 6-17 Operation Type Window Selection for Request-Response Synchronous Interaction

Description of Figure 6-17 follows
Description of "Figure 6-17 Operation Type Window Selection for Request-Response Synchronous Interaction"

The window that appears after selecting the Get Message from MQ and send Reply/Reports operation type is shown in Figure 6-18. Specify the queue name from which the MQSeries adapter will dequeue the message in this window.

Figure 6-18 Get Message from MQ and Send Reply/Reports Window

Description of Figure 6-18 follows
Description of "Figure 6-18 Get Message from MQ and Send Reply/Reports Window"

When you click Next in the Get Message from MQ and send Reply/Reports window, the Response window shown in Figure 6-19 is displayed.

Figure 6-19 Response Window for Synchronous Request-Response

Description of Figure 6-19 follows
Description of "Figure 6-19 Response Window for Synchronous Request-Response"

You can specify the following properties in the Response window:

  • Response Fallback Queue Name: The queue to which the response should be sent for a normal message.

    Note:

    The Response fallback queue should be the primary queue of its queue manager.
  • Response Fallback Queue Manager: The name of the queue manger to which the response fallback queue belongs.

  • Priority: The priority of the message.

  • Persistence: The persistence of the message.

  • Expiry: The expiry time of the message.

Refer to Section 6.3.2, "Message Properties" for more information about these properties.

On clicking Next in the Response window, the Messages window shown in Figure 6-15 is displayed. You can perform the following tasks in this window:

  • Specify if native format translation is not required

  • Select the XSD schema file for translation

  • Start the Native Format Builder Wizard to create an XSD file from file formats such as CSV, fixed-length, DTD, and COBOL Copybook

See Section 6.3.1.1, "Enqueue Message" for more information about the Messages window.

6.3.1.5 Asynchronous Request-Response (Oracle BPEL Process Manager as Server)

In Oracle BPEL Process Manager initiated request-response interaction, a BPEL process receives a request as an inbound message, processes it, and then sends the response through an invoke activity. For asynchronous request-reply scenario, the MQSeries adapter performs the following operations:

  1. Dequeues the message from the queue when a message arrives.

  2. Reads and translates the message based on the translation logic defined at design time.

  3. Publishes the message as XML message to Oracle BPEL Process Manager. The Oracle BPEL Process Manager processes the request and sends the response to the MQSeries adapter.

  4. Receives messages from Oracle BPEL Process Manager.

  5. Formats the XML content as specified at design time.

  6. Sets the properties of the message, such as priority, expiry, message type, and persistence. These properties are based on the selections that you made in the Adapter Configuration wizard.

  7. Sends the message to the queue specified at design time in the Adapter Configuration wizard.

Figure 6-20 shows a sample BPEL process for this scenario.

Figure 6-20 Asynchronous Request-Response Oracle BPEL Process Managerr as Server sample

Description of Figure 6-20 follows
Description of "Figure 6-20 Asynchronous Request-Response Oracle BPEL Process Managerr as Server sample"

Figure 6-21 displays the operation type that you need to select in the Adapter Configuration wizard.

Figure 6-21 Operation Type Window Selection for Request-Response Asynchronous Interaction

Description of Figure 6-21 follows
Description of "Figure 6-21 Operation Type Window Selection for Request-Response Asynchronous Interaction"

The window that appears after selecting the Get Message from MQ and send Reply/Reports operation type is shown in Figure 6-18. Specify the queue name from which the MQSeries adapter will dequeue the message in this window.

When you click Next in the Get Message from MQ and send Reply/Reports window, the Response window shown in Figure 6-19 is displayed.

You can specify the following properties in the Response window:

  • Response Fallback Queue Name: The queue to which the reply should be sent if the replyto queue is not specified in the request message.

  • Response Fallback Queue Manager: The name of the queue manger to which the response fallback queue belongs.

  • Priority: The priority of the message.

  • Persistence: The persistence of the message.

  • Expiry: The expiry time of the message.

Refer to Section 6.3.2, "Message Properties" for more information about these properties.

On clicking Next in the Response window, the Messages window shown in Figure 6-15 is displayed. You can perform the following tasks in this window:

  • Specify if native format translation is not required

  • Select the XSD schema file for translation

  • Start the Native Format Builder Wizard to create an XSD file from file formats such as CSV, fixed-length, DTD, and COBOL Copybook

See Section 6.3.1.1, "Enqueue Message" for more information about the Messages window.

In asynchronous request-reply interaction, you must map the following properties from the inbound message header to the outbound message header:

  • MsgID

  • CorrelID

  • CorrelationScheme

  • ReplyToQ

You can use the Assign activity to map these properties.

6.3.1.6 Request-Response Synchronous (Oracle Enterprise Service Bus as Server)

In this scenario, the Oracle Enterprise Service Bus receives a request, processes it, and sends the response synchronously. The MQSeries adapter performs the following operations:

  1. Dequeues the request message from the queue when the message arrives.

  2. Reads and translates the message based on the translation logic defined at design time.

  3. Publishes the message as XML message to Oracle Enterprise Service Bus. The Oracle Enterprise Service Bus processes the request and sends the response to the MQSeries adapter.

  4. Receives the response message from the Oracle Enterprise Service Bus.

  5. Formats the XML content as specified at the design time.

  6. Sets the properties of the message such as priority, expiry, message type, and persistence. These properties are based on the selections that you made in the Adapter Configuration wizard.

  7. Sends the message to the queue specified at design time in the Adapter Configuration wizard.

Figure 6-22 displays the operation type that you must select in the Adapter Configuration wizard.

Figure 6-22 Oracle Enterprise Service Bus as Server-Request-Response Synchronous Interaction

Description of Figure 6-22 follows
Description of "Figure 6-22 Oracle Enterprise Service Bus as Server-Request-Response Synchronous Interaction"

From this window onwards, all the window are similar to the windows explained in Section 6.3.1.4, "Synchronous Request-Response (Oracle BPEL Process Manager as Server)" .

6.3.2 Message Properties

The MQSeries adapter supports the following message properties:

6.3.2.1 Messages Types

The MQSeries adapter supports the following four types of messages:

  • Normal Message

    A normal message is sent by one program to another program without expecting any response.

  • Request Message

    A request message is sent by one program to another program requesting for a response.

  • Reply Message

    A reply message is sent by a program in response to a request message.

  • Report Message

    A report message is sent by receiving program to sending program as confirmation of successful or unsuccessful delivery of a message. A report message can be generated for any of the message types, normal message, request message, or reply message.

    For information on acknowledgment messages supported by the MQSeries adapter, refer to Section 6.3.5, "Report Messages".

6.3.2.2 Message Format

You can specify the format of an for an outgoing message through Adapter Configuration wizard, as shown in Figure 6-6. Following message formats are supported:

  • No format name (Default)

  • Command server request/reply message

  • Type 1 command reply message

  • Type 2 command reply message

  • Dead-letter header

  • Event message

  • User-defined message in programmable command format

  • Message consisting entirely of characters

  • Trigger message

  • Transmission queue header

6.3.2.3 Message Expiry

You can specify the expiry time for an outgoing message Adapter Configuration wizard shown in Figure 6-6. The queue manager discards the message after the expiry time of a message has elapsed.

If a message has expiration notification set, then a notification is generated when the message is discarded. The notification is sent to the queue specified in the replyToQueue parameter. By default, NEVER is set for the expiry field.

6.3.2.4 Message Priority

You can specify the priority of an outgoing message through Adapter Configuration wizard, as shown in Figure 6-6. A priority can be in the range of 0 (low) to 9 (high). You can also specify the priority of the message to be taken from the default priority attribute, as defined by the destination queue. By default, AS_Q_DEF is set as message priority.

6.3.2.5 Message Persistence

You can specify the persistence of an outgoing message through Adapter Configuration wizard shown in Figure 6-6. If message persistence is not set, a message is lost when the queue manager restarts or there is a system failure. If you set persistence for a message to true, it means that the message will not be lost even if there is system failure or the queue manager is restarted. You can also specify the persistence of the message to be taken from the default priority attribute, as defined by the destination queue. Persistent messages are written to log files and queue data files. If a queue manager is restarted after a failure, it recovers these persistent messages from these files.

Note:

You can specify all these message properties at run time through message headers. You can use the assign activity to assign values to these properties.

6.3.3 Correlation Schemas

Correlation is required for mapping a response to a request in a request-reply interaction. Each MQSeries request message contains a message ID and a correlation ID. When an application receives a request message from Oracle BPEL Process Manager, it checks for the correlation schema defined for the response message. Based on the correlation schema, the application generates the message ID and correlation ID of the response message.

The response window of the Adapter Configuration wizard shown in Figure 6-23 enables you to specify the correlation schema for the response message.

Figure 6-23 Selecting Correlation Schemas

Description of Figure 6-23 follows
Description of "Figure 6-23 Selecting Correlation Schemas"

The Message ID box shown in Figure 6-23 provides the following options for the message ID of the response message:

  • Generate a new message ID for the response message

  • Use the message ID of the request message

Similarly, the Correlation ID box shown in Figure 6-23 provides the following options for the correlation ID of the response message:

  • Use the message ID of the request message

  • Use the correlation ID of the request message

6.3.4 Distribution List Support

The MQSeries adapter enables you to enqueue a message to multiple queues. You can use the DisributionList parameter of the adapter WSDL file for this. For example:

DistributionList="Queue1Name,QueueManger1Name; Queue2Name,QueueManger2Name"

The queue name and queue manager name value pairs should be separated by semi colon (;). The queue manager name is optional.

6.3.5 Report Messages

The MQSeries adapter enables you to set various types of acknowlegement messages on an outgoing message. These acknowlegement messages are known as report messages. A report message is generated only if the criteria for generating that report message is met. When enqueuing a message on a queue, you can request for more than one type of report message. When you request for a report message, you must specify the queue name to which the report message will be sent. This queue is known as replyTo queue. A report message can be generated by a queue manager, a message channel, or an application.

The MQSeries adapter supports the following message reports:

  • Confirmation on Arrival

    The Confirmation on Arrival (COA) message indicates that the message has been delivered to the target queue manager. A COA message is generated by the queue manager. This message report can be selected in the Reports window of the Adapter Configuration window shown in Figure 6-13.

  • Confirmation on Delivery

    A Confirmation on Delivery (COD) message indicates that the message has been retrieved by the receiving application. A COD message is generated by the queue manager. This message report can be selected in the Reports window shown in Figure 6-13.

  • Exception Report

    An exception report is generated when a message cannot be delivered to the specified destination queue. Exception reports are generated by the message channel. This message report can be selected in the Reports window of the Adapter Configuration window shown in Figure 6-13.

  • Expiry Report

    An expiry report indicates that the message was discarded because the expiry time specified for the message elapsed before the message could be delivered. An expiry report is generated by a queue manager. This message report can be selected in the Reports window of the Adapter Configuration window shown in Figure 6-13.

  • Positive Action Notification

    A Positive Action Notification (PAN) indicates that a request has been successfully processed. It means that the action requested in the message has been performed successfully. This type of report is generated by the application.

  • Negative Action Notification

    A Negative Action Notification (NAN) indicates that a request has not been successfully serviced. It means that the action requested in the message has not been performed successfully. This type of report is generated by the application.

You can specify whether all these report messages except PAN and NAN should contain the complete original message, a part of the original message, or no part of the original message. You can select one of the following options in the Adapter Configuration wizard:

  • No data from the original message

  • The first 100 bytes of data in original message

  • The entire original message

6.3.6 Filter-by Criteria

The MQSeries adapter enables you to filter the messages by priority in the inbound interaction. When you specify a priority in the FilterByPriority parameter, the MQSeries adapter checks the queue for the messages that have same priority, as specified in the FilterByPriority parameter. The following example shows how to set the FilterByPriority parameter:

FilterByPriority= "2"

6.3.7 Message Delivery Failure Options

The MQSeries adapter enables you to specify the action that should be taken in case a message could not be delivered to the destination queue. You can specify one of the following actions:

  • Place message on a dead-letter queue

    This is the default action. Message is placed on a dead-letter queue if it cannot be delivered to the destination queue. A report message is generated if requested by the sender. Specify DeadLetterQueue as value of the OnDeliverFailure parameter in the adapter WSDL file as shown in the following example:

    OnDeliverFailure="DeadLetterQueue"
    
    
  • Discard message

    This indicates that the message should be discarded if it cannot be delivered to the destination queue. A report message is generated, if requested by the sender. Specify Discard as value of the OnDeliverFailure parameter in the adapter WSDL file as shown in the following example:

    OnDeliverFailure="Discard"
    
    

6.3.8 Message Segmentation

The MQSeries adapter supports message segmentation for both inbound and outbound interactions. Segmentation is required when size of a message is greater than the message size specified in the queue manager. A physical message is divided into two or more logical messages. All logical messages have same group ID and a sequence number, and an offset.

In the inbound interaction, the segmentation is inherently supported by the MQSeries adapter. The MQSeries adapter dequeues all logical messages in the order of sequence number and then publishes the single message as XML to Oracle BPEL Process Manager or Oracle Enterprise Service Bus.

In the outbound interaction, you can set the SegmentIfRequired parameter to segment the outgoing message, if required. For example:

SegmentIfRequired="true"

The message will be segmented based on constraints such as, if the size of the message is larger than the maximum limit set on the queue.

6.3.9 Message Grouping

The MQSeries adapter supports message grouping for both inbound and outbound interactions. Messages belonging to a group can be complete messages or logical segments of a physical message.

In the inbound interaction, grouping is inherently supported by the MQSeries adapter. The MQSeries adapter dequeues all the messages that belong to same group or that have same group ID in the order of sequence number and publishes the single message as XML to Oracle BPEL Process Manager or Oracle Enterprise Service Bus.

Note:

Message grouping is not supported when the inbound messages have an opaque schema.

In the outbound interaction, grouping is supported through headers. You have to generate same group ID for all messages and also specify the sequence number. The message in the group should be marked with last-msg-in-group flag. In Oracle BPEL Process Manager, you can use the assign activity to set these properties. For example, you want to send three messages as part of the same group:

For the first message, set the following properties through Assign activity:

  • IsMsgInGroup: This property should be set to true.

  • GroupId: A group id can be generated by the queue manager or you can specify your own group id. If you want to the queue manager to generate the group id, set the GroupId as GENERATE_GROUP_ID.

  • MsgSeqNumber: This property should be set to 1.

  • IsLastMsgInGroup: This property should be set to false.

Figure 6-24 shows the assign activity dialog box:

Figure 6-24 Assign Activity Box

Description of Figure 6-24 follows
Description of "Figure 6-24 Assign Activity Box"

For the second message, first copy the GroupId of the first message from the message header to the second message header, as shown in Figure 6-25 .

Figure 6-25 Copy Message GroupIDs

Description of Figure 6-25 follows
Description of "Figure 6-25 Copy Message GroupIDs"

Next, set the following properties through Assign activity:

  • IsMsgInGroup: This property should be set to true.

  • MsgSeqNumber: This property should be set to 2.

  • IsLastMsgInGroup: This property should be set to false.

For the last message, you again need to assign the Groupid similar to the first and second message and then specify the following properties:

  • IsMsgInGroup: This property should be set to true.

  • MsgSeqNumber: This property should be set to 3.

  • IsLastMsgInGroup: This property should be set to true.

6.3.10 Integration with CICS

The MQSeries adapter provides support for sending and receiving messages from CICS server. In the inbound direction, an inbound message from CICS server is dequeued in same way as a normal message. In outbound direction, the message should be in the CICS format. A sample schema file for outbound CICS message format is shown in the following example:

<?xml version="1.0" ?><schema xmlns="http://www.w3.org/2001/XMLSchema"
        targetNamespace="http://xmlns.oracle.com/pcbpel/nxsd/cics_mqcih"
        elementFormDefault="qualified"
        attributeFormDefault="unqualified"
        
        xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
        nxsd:version="NXSD"
        
        nxsd:encoding="UTF8"
        nxsd:stream="bytes"
        nxsd:byteOrder="bigEndian"
        
        xmlns:nxsd_extn="http://xmlns.oracle.com/pcbpel/nxsd/extensions"

<element name="MSGForMQCICSBridge">
    <complexType>
      <sequence>
        <element name="MQCIH">
          <complexType>
            <sequence>
              <!--
              MQCHAR4   StrucId;
              Structure identifier
              -->
              <element name="StrucId" type="string"
               nxsd:style="fixedLength" nxsd:length="4" nxsd:padStyle="tail"/>
              
              <!--
              MQLONG    Version;
              Structure version number 1 or 2
              -->
              <element name="Version" type="string"
               nxsd:style="integer" nxsd_extn:octet="4"
               nxsd_extn:align="0" nxsd_extn:sign="unticked" />
              <!--
              MQLONG    StrucLength;
              Length of MQCIH structure V1=164 V2=180
              -->
              <element name="StrucLength" type="string"
               nxsd:style="integer" nxsd_extn:octet="4"
               nxsd_extn:align="0" nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG    Encoding;
              Reserved
              -->
              <element name="Encoding" type="string"
               nxsd:style="integer" nxsd_extn:octet="4"
               nxsd_extn:align="0" nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG    CodedCharSetId;
              Reserved              -->
              <element name="CodedCharSetId" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQCHAR8   Format;
              MQ Format name
              -->
              <element name="Format" type="string"
              nxsd:style="fixedLength" nxsd:length="8" />
              
              <!--
              MQLONG    Flags;
              Reserved
              -->
              <element name="Flags" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 

               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   ReturnCode;
              Return code from bridge
              -->
              <element name="ReturnCode" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   CompCode;
              MQ completion code or CICS EIBRESP
              -->
              <element name="CompCode" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   Reason;
              MQ reason or feedback code, or CICS EIBRESP2
              -->
              <element name="Reason" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   UOWControl;
              Unit-of-work control
              -->
              <element name="UOWControl" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   GetWaitInterval;
              Wait interval for MQGET call issued by bridge
              -->
              <element name="GetWaitInterval" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="ticked" />
              
              <!--
              MQLONG   LinkType;
              Link type
              -->
              <element name="LinkType" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
              nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   OutputDataLength;
              Output commarea data length
              -->
              <element name="OutputDataLength" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="ticked" />
              
              <!--
              MQLONG   FacilityKeepTime;
              Bridge facility release time
              -->
              <element name="FacilityKeepTime" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   ADSDescriptor;
              Send/receive ADS descriptor
              -->
              <element name="ADSDescriptor" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   ConversationalTask;
              Whether task can be conversational
              -->
              <element name="ConversationalTask" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
                            <!--
              MQLONG   TaskEndStatus;
              Status at end of task
              -->
              <element name="TaskEndStatus" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              
              <!--
              MQBYTE   Facility[8];
              BVT token value. Initialise as required.
              -->
              <element name="Facility" type="string"
               nxsd:style="integer" nxsd_extn:octet="8" nxsd_extn:align="0" 
               nxsd _extn:sign="unticked" />
              
              <!--
              MQCHAR4  Function;
              MQ call name or CICS EIBFN function name
              -->
              <element name="Function" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  AbendCode;
              Abend code
              -->
              <element name="AbendCode" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR8  Authenticator;
              Password or passticket
              -->
              <element name="Authenticator" type="string"
              nxsd:style="fixedLength" nxsd:length="8" />
              
              <!--
              MQCHAR8  Reserved1;
              Reserved
              -->
              <element name="Reserved1" type="string"
               nxsd:style="fixedLength" nxsd:length="8" />
              
              <!--
              MQCHAR8  ReplyToFormat;
              MQ format name of reply message
              -->
              <element name="ReplyToFormat" type="string"
               nxsd:style="fixedLength" nxsd:length="8" />
              
              <!--
              MQCHAR4  RemoteSysId;
              Remote sysid to use
              -->
              <element name="RemoteSysId" type="string"
              nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  RemoteTransId;
              Remote transid to attach
              -->
              <element name="RemoteTransId" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  TransactionId;
              Transaction to attach
              -->
              <element name="TransactionId" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  FacilityLike;
              Terminal emulated attributes
              -->
              <element name="FacilityLike" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  AttentionId;
              AID key
              -->
              <element name="AttentionId" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  StartCode;
              Transaction start code
              -->
              <element name="StartCode" type="string"
              nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  CancelCode;
              Abend transaction code
              -->
              <element name="CancelCode" type="string"
               nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR4  NextTransactionId;
              Next transaction to attach
              -->
              <element name="NextTransactionId" type="string"
              nxsd:style="fixedLength" nxsd:length="4" />
              
              <!--
              MQCHAR8  Reserved2;
              Reserved
              -->
              <element name="Reserved2" type="string"
              nxsd:style="fixedLength" nxsd:length="8" />
              <!--
              MQCHAR8  Reserved3;
              Reserved
              -->
              <element name="Reserved3" type="string"
              nxsd:style="fixedLength" nxsd:length="8" />
              
              <!--
              MQLONG   CursorPosition;
              Cursor position
              -->
              <element name="CursorPosition" type="string"
              nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
              nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   ErrorOffset;
              Error offset
              -->
              <element name="ErrorOffset" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   InputItem;
              Input item
              -->
              <element name="InputItem" type="string"
               nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
               nxsd_extn:sign="unticked" />
              
              <!--
              MQLONG   Reserved4;
              Reserved
              -->
              <element name="Reserved4" type="string"
              nxsd:style="integer" nxsd_extn:octet="4" nxsd_extn:align="0" 
              nxsd_extn:sign="unticked" />
            </sequence>
          </complexType>
        </element>
        
        <!--
        Application data
        -->
        <element name="ApplicationData" type="string"
                                      fixed="Nothing" />
        
      </sequence>
    </complexType>
  </element>
</schema>

6.4 Configuring the MQSeries Adapter

The setup prerequisite for using the MQSeries adapter are:

To configure the MQSeries adapter, perform the following:

6.4.1 Add the com.ibm.mq.jar to the MQSeries Adapter Classpath

The steps in this section should be performed only once, before using the MQSeries adapter. Perform the following steps to add the com.ibm.mq.jar to the classpath for the MQSeries adapter:

  1. Copy the com.ibm.mq.jar file to the any folder.

  2. Create a new shared library in the server.xml file by specifying the path of the com.ibm.mq.jar as shown in the following example:

    <shared-library name="oracle.mqseries" version="10.1.3">
         <code-source path="C:\ORAHOME\bpel/lib/com.ibm.mq.jar"/>
    </shared-library>
    
    

    The location of the server.xml file depends on your installation type. Table 6-3 lists the installation type and corresponding server.xml file location.

    Table 6-3 server.xml File Location

    Installation Type File Location

    SOA Basic Installation

    Oracle_Home\j2ee\home\config

    Oracle Enterprise Service Bus on Oracle Application Server Middle tier

    Oracle_Home\j2ee\homemid\config

    Oracle BPEL Process Manager on Oracle Application Server Middle tier

    Oracle_Home\j2ee\homemid\config


  3. Modify the oc4j-ra.xml file to include the new shared library as shown in the following example.

    <imported-shared-libraries>
      <import-shared-library name="oracle.bpel.common"/>
      <import-shared-library name="oracle.xml"/>
      <import-shared-library name="oracle.mqseries"/>
    </imported-shared-libraries>
    
    

    The location of the oc4j-ra.xml file depends on your installation type. Table 6-4 lists the installation type and corresponding oc4j-ra.xml file location.

    Table 6-4 oc4j-ra.xml File Location

    Installation Type File Location

    SOA Basic Installation

    Oracle_Home\j2ee\home\application-deployments\default\MQSeriesAdapter

    Oracle Enterprise Service Bus on Oracle Application Server Middle tier

    Oracle_Home\j2ee\homemid\application-deployments\default\MQSeriesAdapter

    Oracle BPEL Process Manager on Oracle Application Server Middle tier

    Oracle_Home\j2ee\homemid\application-deployments\default\MQSeriesAdapter


  4. Restart the server.

6.4.2 Modify the oc4j-ra.xml File

Specify the value of the following parameters in the oc4j-ra.xml file:

  • hostName: The name of the computer on which the IBM Websphere MQ server is running.

  • portNumber: The port number for connecting to the IBM Websphere MQ server.

  • queueManagerName: The name of the primary queue manager.

  • channelName: The name of channel.

  • userID: The user ID if connecting to IBM Websphere MQ server. running on a remote location.

  • password: The password corresponding to the user ID.

  • clientEncoding: This parameter is required if you are encoding the message header.

  • hostOSType: This parameter should be specified if the Websphere server is running on a zSeries/Operating System (z/OS). The value should be zos.

Note:

Properties of the MQSeries queues should be set as specified in the following list:
  • The shareability property of MQSeries queues should be set to Shareable.

  • Index type of the MQSeries queues should be set to MQIT_MSG_ID.

A sample oc4j-ra.xml file is shown in the following example:

<connector-factory location="eis/MQ/MQSeriesAdapter" connector-name="MQSeriesAdapter">
    <config-property name="hostName" value="localhost"/>
    <config-property name="portNumber" value="1414"/>
    <config-property name="queueManagerName" value="QM"/>
    <config-property name="channelName" value="MYCHANNEL"/>
    <config-property name="userID" value=""/>
    <config-property name="password" value=""/>
    <config-property name="clientEncoding" value=""/>
    <config-property name="hostOSType" value=""/>
    <connection-pooling use="private">
       <property name="waitTimeout" value="300" />
       <property name="scheme" value="fixed_wait" />
       <property name="maxConnections" value="50" />
       <property name="minConnections" value="0" />
    </connection-pooling>
    <security-config use="none">
    </security-config>
</connector-factory>

6.5 MQSeries Adapter Use Cases for Oracle BPEL Process Manager

This section contains the following use cases:

6.5.1 Message Enqueue/Dequeue

In this use case, the inbound MQSeries adapter dequeues the message from MQSeries queue test_in and publishes it to the BPEL process. A BPEL receive activity consumes the incoming MQSeries message and the same message is sent to the MQSeries queue test_out through a BPEL activity. This use case consists of following sections:

6.5.1.1 Prerequisites

This example assumes that you are familiar with basic BPEL constructs, such as activities and partner links, and Oracle JDeveloper environment for creating and deploying BPEL Process.

The MQSeries adapter must be configured as specified in Section 6.4, "Configuring the MQSeries Adapter" and two queue test_in and test_out should be created.

To define the schema of the messages, you require the address-csv.xsd file. This file can be copied from the following location:

ORAHOME\bpel\samples\tutorials\121.FileAdapter\FlatStructure

6.5.1.2 Creating the Inbound Adapter Service

Perform the following steps in Oracle JDeveloper to create an adapter service that will enqueue the message to a queue.

  1. In the Application Navigator, right-click Applications and select New Application. The Create Application dialog box is displayed.

  2. Enter EnqueueDequeue in the Application Name field and click OK. The Create Project dialog box is displayed.

  3. Click Cancel.

  4. In the Application Navigator, right-click EnqueueDequeue and select New Project. The New Gallery dialog box is displayed.

  5. From Categories, select General, and then Projects.

  6. From Items, select BPEL Process Project and click OK. The BPEL Process Creation Wizard-Project Settings dialog box is displayed.

  7. Perform the following as shown in Figure 6-26.

    1. Enter Simple_Dequeue_Enqueue in the Name field.

    2. Select Empty BPEL Process from the Templatelist.

    3. Click Finish.

    Figure 6-26 BPEL Process Creation Wizard-Project Settings Dialog Box

    Description of Figure 6-26 follows
    Description of "Figure 6-26 BPEL Process Creation Wizard-Project Settings Dialog Box"

  8. Create a Schema folder and copy the address-csv.xsd file to this folder.

  9. Move the Schema folder to bpel sub directory of Simple_Dequeue_Enqueue project directory.

  10. Drag a Partner Link activity from the Component Palette to the design area. The Create Partner Link dialog box is displayed.

  11. Enter Inbound in the Name field and click the Define Adapter Service icon shown in Figure 6-27.

    Figure 6-27 Adapter Configuration icon

    Description of Figure 6-27 follows
    Description of "Figure 6-27 Adapter Configuration icon"

  12. Click Next in the Welcome window of the Adapter Configuration Wizard. The Adapter Type window is displayed.

  13. Select MQ Adapter and click Next. The Service Name window is displayed.

  14. Enter inboundService in the Service Name field and click Next. The MQ Series Connection window is displayed.

  15. Specify the JNDI name for the run-time connection, as shown in Figure 6-28 and click Next.

    Figure 6-28 MQ Series Connection Window

    Description of Figure 6-28 follows
    Description of "Figure 6-28 MQ Series Connection Window"

  16. Select Get Message from MQ in the Operation Type window and click Next.

  17. Enter test_in in the Queue Name field as shown in Figure 6-29 and click Next. The MQSeries adapter will dequeue the message from this queue.

    Figure 6-29 Get Message from MQ window

    Description of Figure 6-29 follows
    Description of "Figure 6-29 Get Message from MQ window"

  18. Click Browse in the Messages window. The Type Chooser dialog box is displayed.

  19. Select Project Schema Files, address-csv.xsd and then Root-Element, as shown in Figure 6-30 and click OK.

    Figure 6-30 Type Chooser Dialog Box

    Description of Figure 6-30 follows
    Description of "Figure 6-30 Type Chooser Dialog Box"

  20. Click Next in the Messages window.

  21. Click Finish. The Create Partner Link dialog box appears, as shown in Figure 6-31.

    Figure 6-31 inboundService Create Partner Link dialog box

    Description of Figure 6-31 follows
    Description of "Figure 6-31 inboundService Create Partner Link dialog box "

  22. Click OK.

6.5.1.3 Creating the Outbound Adapter Service

Perform the following steps to create an adapter service that will dequeue the message from a queue.

  1. Drag a Partner Link activity from the Component Palette to the design area. The Create Partner Link dialog box is displayed.

  2. Enter Outbound in the Name field and click the Define Adapter Service icon shown in Figure 6-27.

  3. Click Next in the Welcome window of the Adapter Configuration Wizard. the Adapter Type window is displayed.

  4. Select MQ Adapter and click Next. The Service Name window is displayed.

  5. Enter outboundService in the Service Name field and click Next. The MQ Series Connection window is displayed.

  6. Specify the JNDI name for the run-time connection as shown in Figure 6-28 and click Next. The Operation Type window is displayed.

  7. Select Put Message into MQ and click Next.

  8. Enter test_out in the Queue Name field. The MQSeries adapter will enqueue the message to this queue. Leave the other fields to default, as shown in Figure 6-32.

    Figure 6-32 Get Message from MQ window

    Description of Figure 6-32 follows
    Description of "Figure 6-32 Get Message from MQ window"

  9. Click Next. The Messages window is displayed.

  10. Click Browse. The Type Chooser dialog box is displayed.

  11. Select Project Schema Files, address-csv.xsd and then Root-Element as shown in Figure 6-30 and click OK.

  12. Click Next.

  13. Click Finish. The Create Partner Link dialog box appears, as shown in Figure 6-33.

    Figure 6-33 OutboundService Create Partner Link dialog box

    Description of Figure 6-33 follows
    Description of "Figure 6-33 OutboundService Create Partner Link dialog box "

  14. Click OK.

6.5.1.4 Creating the Receive Activity

Perform the following steps to create a Receive activity to instantiate a BPEL process instance when it receives a message from the MQSeries adapter:

  1. Drag the Receive activity from the Components palette to the Drop Activity Here section.

  2. Join the Receive activity to the inboundService partner link. The Edit Receive dialog box is displayed.

  3. Enter ReadMsg in the Name field.

  4. Click the Auto-Create Variable icon next to the Variable field. The Create variable dialog box is displayed, as shown in Figure 6-34.

    Figure 6-34 Create Variable dialog box

    Description of Figure 6-34 follows
    Description of "Figure 6-34 Create Variable dialog box"

  5. Click OK. The ReadMsg_Dequeue_InputVariable variable is created.

  6. Select Create Instance. The Edit Receive dialog box appears as shown in Figure 6-35.

    Figure 6-35 Edit Receive Dialog Box

    Description of Figure 6-35 follows
    Description of "Figure 6-35 Edit Receive Dialog Box"

  7. Click OK.

6.5.1.5 Creating the Invoke Activity

Perform the following steps to create an Invoke activity that will send the message to partner link, which enqueues the message to the outbound queue:

  1. Drag an Invoke activity below the receive activity from the Component palette .

  2. Join the Invoke activity to the outboundService partner link. The Edit Invoke dialog box is displayed.

  3. Enter WriteMsg in the Name field.

  4. Click the Auto-Create Variable icon next to the Variable field. The Create variable dialog box is displayed.

  5. Click OK. The WriteMsg_Enqueue_InputVariable variable is created.

  6. Click OK.

6.5.1.6 Creating the Assign Activity

Perform the following steps to create an Assign activity:

  1. Drag an Assign activity from the Component Palette between the ReadMsg and the WriteMsg activity.

  2. Double-click the Assign activity.

  3. In the Copy operation tab, click Create and then select Copy Operation. The Create Copy Operation dialog box is displayed.

  4. In the From group, select Variable, Process, Variables, ReadMsg_Dequeue_InputVariable, Root-Element, ns3:Root-Element, as shown in Figure 6-36.

  5. In the To group, select Variable, Process, Variables, WriteMsg_Enqueue_InputVariable, Root-Element, ns3:Root-Element, as shown in Figure 6-36.

    Figure 6-36 Create Copy Operation Dialog Box

    Description of Figure 6-36 follows
    Description of "Figure 6-36 Create Copy Operation Dialog Box"

  6. Click OK. The Assign activity dialog box appears, as shown in Figure 6-37.

    Figure 6-37 Assign Activity Dialog Box

    Description of Figure 6-37 follows
    Description of "Figure 6-37 Assign Activity Dialog Box "

  7. Click OK. The Oracle JDeveloper appears, as shown in Figure 6-38.

    Figure 6-38 Simple_Enqueue_Dequeue Use Case Design View

    Description of Figure 6-38 follows
    Description of "Figure 6-38 Simple_Enqueue_Dequeue Use Case Design View"

6.5.1.7 Run-Time

Perform the following steps to test the run-time of this scenario:

  1. In the Applications window, click Applications and then right-click Simple_Dequeue_Enqueue.

  2. Deploy the application.

  3. Put the following text message to the test_in queue:

    Name,Street1,Street2,City,State,Country;
    
    

    The same text will be written to the test_out queue. Figure 6-39 displays the sample test_out queue to which the data has been written.

    Figure 6-39 Sample test_out Queue

    Description of Figure 6-39 follows
    Description of "Figure 6-39 Sample test_out Queue"

6.5.2 Synchronous Request-Response

In this use case, the inbound MQSeries adapter dequeues the request message from MQSeries inbound queue test_in and publishes it to the BPEL process. The MQSeries adapter waits for the response from the BPEL process. When the MQSeries adapter receives the response, it enqueues the response message to the MQSeries queue specified in the replyTo queue of the request message. This use case consists of following sections:

6.5.2.1 Prerequisites

This example assumes that you are familiar with basic BPEL constructs, such as activities and partner links, and Oracle JDeveloper environment for creating and deploying BPEL Process.

The MQSeries adapter must be configured as specified in Section 6.4, "Configuring the MQSeries Adapter" and two queue test_in and test_out should be created.

To define the schema of the messages, you require the address-csv.xsd and the address-fixedLength.xsd files. This files can be copied from the following location:

ORAHOME\bpel\samples\tutorials\121.FileAdapter\FlatStructure 

6.5.2.2 Creating the Synchronous Request-Response Service

Perform the following steps in Oracle JDeveloper to create an partner link that dequeues the request message from the inbound queue and enqueues the response message to the outbound queue:

  1. In the Application Navigator, right-click Applications and select New Application. The Create Application dialog box is displayed.

  2. Enter SyncReqRes in the Application Name field and click OK. The Create Project dialog box is displayed.

  3. Click Cancel.

  4. In the Applications Navigator, right-click SyncReqRes and select New Project. The New Gallery dialog box is displayed.

  5. From Categories, select General and then Projects.

  6. From Items, select BPEL Process Project and click OK. The BPEL Process Creation Wizard-Project Settings dialog box is displayed.

  7. Perform the following:

    1. Enter Sync_Req_Res in the Name field.

    2. Select Empty BPEL Process from Template box.

    3. Click Finish.

  8. Create a Schema folder and copy the address-csv.xsd file to this folder.

  9. Move the Schema folder to bpel sub directory of Sync_Req_Res project directory.

  10. Drag a Partner Link activity from the Component Palette to the design area. The Create Partner Link dialog box is displayed.

  11. Enter inbound_req_res in the Name field and click the Define Adapter Service icon shown in Figure 6-27. The Welcome window of the Adapter Configuration Wizard is displayed.

  12. Click Next. The Adapter Type window is displayed.

  13. Select MQ Adapter and click Next. The Service Name window is displayed.

  14. Enter inboundService in the Service Name field and click Next. The MQ Series Connection window is displayed.

  15. Specify the JNDI name for the run-time connection in the MQ Series Connection JNDI Name field as shown in Figure 6-28 and click Next. The Operation Type window is displayed.

  16. Select Get message from MQ and Send Reply/Reports.

  17. Select Synchronous option as shown in Figure 6-17 and click Next. The Get message from MQ and Send Reply/Reports window is displayed.

  18. Enter test_in in the Queue Name field and click Next. The Response window shown in Figure 6-19 is displayed.

  19. Specify the name of the response fallback queue in the Response Fallback Queue Name field and click Next. The Messages window shown in Figure 6-15 is displayed.

  20. In the Get Messages Schema group, click Browse. The Type Chooser dialog box is displayed.

  21. Select Project Schema Files, address-csv.xsd and then Root-Element and click OK.

  22. In the Send Messages Schema group, click Browse. The Type Chooser dialog box is displayed.

  23. Click Browse in the Messages window. The Type Chooser dialog box is displayed.

  24. Select Project Schema Files, address-fixedLength.xsd and then Root-Element and click OK.

  25. Click Next in the Messages window.

  26. Click Finish.

  27. In the Create Partner Link dialog box, select Dequeue_role from the My Role box as shown in Figure 6-40.

    Figure 6-40 Synchronous Request-Response Use Case Create Partner Link Dialog Box

    Description of Figure 6-40 follows
    Description of "Figure 6-40 Synchronous Request-Response Use Case Create Partner Link Dialog Box"

  28. Click OK.

6.5.2.3 Creating the Receive Activity

Perform the following steps to create a Receive activity that instantiates a BPEL Process instance when it receives a message from the MQSeries adapter:

  1. Drag the Receive activity from the Components palette to the Drop Activity Here section.

  2. Join the receive activity to the inboundService partner link. The Edit Receive dialog box is displayed.

  3. Enter ReadMsg in the Name field.

  4. Click the Auto-Create Variable icon next to the Variable field. The Create variable dialog box is displayed.

  5. Click OK. A ReadMsg_DequeueEnqueue_InputVariable variable is created.

  6. Select Create Instance. The Edit Receive dialog box appears, as shown in Figure 6-35.

    Figure 6-41 Edit Receive Dialog Box

    Description of Figure 6-41 follows
    Description of "Figure 6-41 Edit Receive Dialog Box"

  7. Click OK.

6.5.2.4 Creating the Reply Activity

Perform the following steps to create a Reply activity that will send the response to the inboundService partnerlink.

  1. Drag the Reply activity from the Components palette to below the ReadMsg activity.

  2. Join the reply activity to the inboundService partner link. The Edit Reply dialog box is displayed.

  3. Enter ReplyMsg in the Name field.

  4. Click the Auto-Create Variable icon next to the Variable field. The Create variable dialog box is displayed.

  5. Click OK. A ReplyMsg_DequeueEnqueue_OutputVariable variable is created. The Edit Reply dialog box appears, as shown in Figure 6-42.

    Figure 6-42 Edit Reply Dialog Box

    Description of Figure 6-42 follows
    Description of "Figure 6-42 Edit Reply Dialog Box"

  6. Click OK.

6.5.2.5 Creating the Transform Activity

Perform the following steps to map the ReadMsg_DequeueEnqueue_InputVariable variable to ReplyMsg_DequeueEnqueue_OutputVariable variable:

  1. Drag the Transform activity from the Components palette to between the ReadMsg and the ReplyMsg activity.

  2. Double-click the Trasnform activity.

  3. From the Source Variable box, select ReadMsg_DequeueEnqueue_InputVariable.

  4. From the Target Variable box, select ReplyMsg_DequeueEnqueue_OutputVariable.

  5. Click the Create Mappings icon. The Transformation_1.xsl window opens.

  6. Drag the tns:Address element from <source>panel to the Address element of the <target> panel. The Auto Map Preferences dialog box is displayed, as shown in Figure 6-43.

    Figure 6-43 Auto Map Preferences Dialog Box

    Description of Figure 6-43 follows
    Description of "Figure 6-43 Auto Map Preferences Dialog Box"

  7. Deselect Match Elements Considering their Ancestor Names and click OK.

  8. Drag a concat function from the Components palette to the Street1 node in the <source> panel.

  9. Join the Street2 node to the Concat function. The Transformation_1.xsl window appears as shown in .

  10. Close the Transformation_1.xsl window.

6.5.2.6 Run-Time

Perform the following steps to test the run-time of this scenario:

  1. In the Applications navigator, click Applications and then right-click Sync_Req_Res.

  2. Deploy the application.

  3. Put the following text message to the test_in queue:

    Name,Street1,Street2,City,State,Country;
    
    

    The same text will be written to the test_out queue in the following format:

    Name,Street1Street2,City,State,Country;
    

6.5.3 Demonstrations and Samples

A series of demonstrations, activity and conceptual reference materials, and tutorials are provided to increase conceptual knowledge and hands-on experience with Oracle Enterprise Service Bus and Oracle BPEL Process Manager adapters.

These samples are available in the Samples folder.

In addition, you can find updated adapter tutorials at following location:

http://www.oracle.com/technology/products/integration/adapters/dev_support.html#tutorials