8 Oracle JCA Adapter for JMS

Use the Oracle JCA Adapter for JMS (Oracle JMS Adapter) to enable an Oracle BPEL process or an Oracle Mediator component to interact with Java Messaging Service.

8.1 Introduction to the Oracle JMS Adapter

The JMS architecture uses one client interface-to-many messaging servers. The JMS model has two messaging domains, point-to-point and publish-subscribe. In the point-to-point domain, messages are exchanged through a queue and each message is delivered to only one receiver. In the publish-subscribe model, messages are sent to a topic and can be read by many subscribed clients.

8.1.1 Oracle JMS Adapter Integration with the Oracle BPEL Process Manager

The JCA Binding Component is used for the bidirectional integration of the JCA 1.5 resource adapters with BPEL Process Manager. The JCA Binding Component is based on standards and employs the Web service Invocation Framework (WSIF) technology for exposing the underlying JCA interactions as Web services.

For information on Oracle JMS Adapter architecture, adapter integration with Oracle BPEL Process Manager (Oracle BPEL PM), and adapter deployments, see Adapter Integration with Oracle Application Server Components.

8.1.2 Oracle JMS Adapter Integration with Oracle Mediator

Mediator supports Oracle JCA Adapters and enables you to define inbound and outbound adapter services for each. An inbound adapter service receives data from an external messaging system and transforms it into an XML message. An outbound adapter service sends data to a target application by transforming an XML message into the native format of the given adapter.

In the case of the Oracle JMS Adapter service, by using Mediator, you can send or receive messages from a JMS queue or topic.

Oracle BPEL PM predates Mediator, and most of this guide implicitly assume use with Oracle BPEL PM. However, the adapters work equally well with either Oracle BPEL PM or Mediator. For any mention of Oracle BPEL PM in this chapter, you may substitute Mediator, instead.

8.2 Oracle JMS Adapter Features

The Oracle JMS Adapter includes the following features:

  • Based on JMS version 1.0.2b

  • Generic Oracle JMS Adapter

    Should work with any JMS provider. However, Oracle JMS Adapter is certified against AQ JMS (JMS providers OJMS 8.1.7, 9.0.1.4, and 9.2), TIBCO JMS, IBM Websphere MQSeries (IBM MQSeries JMS 6.0), Weblogic JMS, Apache, and Active MQ. Contact Oracle Support for additional providers certification information.

  • Supports JMS topics and queues

  • Supports byte, text, and map message types

    Supports these data types only for this release. The Adapter Configuration Wizard provides the Native Format Builder wizard for consuming native data payloads at runtime. The Native Format Builder wizard creates XSD definitions for the underlying native data.

  • Supports JMS headers and properties

  • Supports WebLogic Server Unit-of-Order feature

    The WebLogic Server Unit-of-Order feature enables a JMS message producer or group of message producers acting as one, to group messages into a single unit that is processed sequentially in the order the messages were created. The message processing of a single message is complete when a message is acknowledged, committed, recovered, or rolled back. Until message processing for a message is complete, the remaining unprocessed messages for that Unit-of-Order are blocked.

    This enhancement enables WebLogic Server Unit-of-Order support in SOA JMS adapter. Messages produced using the SOA JMS adapter would enable the user to specify a specific unit-of-order.

  • Supports jca.message.encoding property

    The Oracle JMS Adapter supports the jca.message.encoding property for inbound and outbound payloads. If the jca.message.encoding property is used along with the adapter.jms.encoding property and the nxsd:encoding attribute, then the jca.message.encoding property takes precedence over the adapter.jms.encoding property, and the nxsd:encoding attribute is given the last preference. The nxsd:encoding value can be UTF-8, which is typically recommended for interoperability and Unicode support. However, you can specify any legal encoding supported by the Java runtime environment. For a complete listing of supported encodings, visit http://docs.oracle.com/javase/7/docs/technotes/guides/intl/encoding.doc.html. You can specify the encoding in the (N)XSD associated with the adapter proxy meta data. For example, you can specify the following attribute, nxsd:encoding="iso-8859-1".

    The jca.message.encoding property is supported as an endpoint defined in composite.xml You can define this property using the Properties tab of the Adapter Configuration Wizard or by editing the composite.xml file. The jca.message.encoding property can be passed as a normalized message property for both inbound and outbound interactions.

    The following code snippet is an example of setting values in the composite.xml file for message encoding for an inbound service:

    <service name="jms_inbound" ui:wsdlLocation="jms_inbound.wsdl">
        <interface.wsdl
       interface="http://xmlns.oracle.com/pcbpel/adapter
                   /jms/utf8/jcamessageencoding/
         jms_inbound#wsdl.interface(Consume_Message_ptt)"/>
        <binding.jca config="jms_inbound_jms.jca">
        <property name="jca.message.encoding" 
                      type="xs:string" many="false"
                    override="may">GBK</property>
      </binding.jca> 
    </service>

    The following code snippet is an example of setting values in the composite.xml file for message encoding for an outbound reference:

    <reference name="jms_outbound" ui:wsdlLocation=
             “jms_outbound.wsdl">
        <interface.wsdl
         interface="http://xmlns.oracle.com/pcbpel/adapter/jms/utf8/jcamessageencoding/
         jms_outbound#wsdl.interface(Produce_Message_ptt)"/>
        <binding.jca config="jms_outbound_jms.jca">
        <property name="jca.message.encoding" type="xs:string" many="false"
                    override="may">GBK</property> 
      </binding.jca> 
    </reference>
  • Supports the JMS message selector

    Supports the JMS message selector for performing filtering while subscribing to JMS topics and queues. This parameter is based on the SQL 92 language for filtering messages based on fields present in the JMS header and properties section.

  • Is DOM2 compliant

    The Oracle JMS Adapter can process and generate document objects that are compliant with DOM2 specification.

  • Supports normalized message

    Header manipulation and propagation is a key business integration messaging requirement. Oracle BPEL PM, Mediator, Oracle JCA, and Oracle B2B rely extensively on header support to solve customers' integration requirements. For example, a user can preserve a file name from the source directory to the target directory by propagating it through message headers. Another example: the outbound Oracle JMS Adapter facilitates asynchronous request/response by propagating the correlationId and the JMSReplyTo address as JMS headers. In Oracle BPEL Process Manager and Mediator, users can access, manipulate, and set headers with varying degrees of UI support.

    For more information, see Correlation Support Within Adapters.

    Propagating Headers in a Normalized Message:

    Normalized Message is simplified to have only two parts, properties and payload. Typically, properties are name-value pairs of scalar types. To fit the existing complex headers into properties, they are flattened into scalar types.

    Manipulating Headers in Design-Time:

    The user experience while manipulating headers in design time is simplified, because the complex properties are predetermined. In Mediator, or Oracle BPEL designer, you can manipulate the headers with some reserved key words. For example, in Mediator designer, you can access an inbound Oracle File Adapter fileName header by using the following expression:

    $nmproperty.InboundFileHeaderType.fileName

    However, this method does not address the properties that are dynamically generated based on your input. For example, in the Oracle AQ Adapter Wizard, you are allowed to propagate some of the fields from an AQ object as headers. Based on this user choice, the header definitions are generated. These definitions are not predetermined and hence cannot be accounted for in the list of predetermined property definitions. The user cannot design header manipulation of the dynamic properties before they are defined. To address this limitation, you must generate all the necessary services (composite entry points) and references. This restriction applies only to those services that are expected to generate dynamic properties. Once dynamic properties are generated, they must be captured in some given location for each composite. Only then can the user manipulate the dynamic properties in the Oracle Mediator or Oracle BPEL designer.

  • Supports specifying a durable JMS subscriber

  • Supports persistent and nonpersistent modes of a JMS publisher

    The JMS API specifies three types of acknowledgments that can be sent by the JMS publisher:

    • DUPS_OK_ACKNOWLEDGE, for consumers that are not concerned about duplicate messages

    • AUTO_ACKNOWLEDGE, in which the session automatically acknowledges the receipt of a message

    • CLIENT_ACKNOWLEDGE, in which the client acknowledges the message by calling the message's acknowledge method

  • Does not support outbound retry functionality for AQJMS on Solaris

    Note:

    When you use the Oracle JMS Adapter to connect to an AQ-JMS provider, and if the database that hosts the AQ destination is 10.1.0.4, then the adapter retry mechanism on the outbound direction fails to reconnect to the database server if the database server goes down. This is because of a client JDBC issue with ojdbc14.jar. To resolve this you must download the 10.1.0.4 JDBC drivers and use them in the mid tier by replacing the libraries, specifically ojdbc14.jar in $MIDTIER_ORACLE_HOME/jdbc. For a detailed explanation about how to resolve this issue, refer to Metalink Note 317385.1.

  • Supports tracking message size

    The Oracle JMS Adapter is message size aware. The Oracle JMS Adapter calculates the message size and reports the size back to the JCA Binding Component. The API, related to size, exposed by the JCA Binding Component can be used for reporting purposes.

  • Support configuring MapMessage in JMS Adapter MapMessage data type

    A MapMessage is used to send a set of name-value pairs where names are strings and values are Java primitive types. The entries can be accessed sequentially or randomly by name. The order of the entries is undefined. It inherits from a message and adds a map message body.

    Oracle JMS adapter provides support for processing MapMessage. It now supports one new ActivationSpec and InteractionSpec property, namely JmsMapMessageConsumeActivationSpec and JmsMapMessageProduceInteractionSpec.

    The following use cases are supported:

    • Use Case 1. Entire JMS MapMessage object is processed as payload.

      If both PayloadEntry and AttachmentList properties are not defined, the entire JMS MapMessage is converted to XML and the XML file is transferred as the payload. For this use case, both PayloadEntry and AttachmentList properties are optional. The following schema is used for conversion:

      <schema targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/jms/MapMessage"
              xmlns="http://www.w3.org/2001/XMLSchema"
              xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/jms/MapMessage"
              elementFormDefault="qualified">
       <element name="MapMessage">
        <complexType>
         <choice maxOccurs="unbounded">
          <element name="entry">
           <complexType>
            <simpleContent>
             <extension base="string">
              <attribute name="name" type="string"/>
              <attribute name="dt" type="string"/>
             </extension>
            </simpleContent>
           </complexType>
          </element>
         </choice>
        </complexType>
       </element>
      </schema>

      The attribute name is the name part of the name value pair for a JMS MapMessage entry.

      The attribute dt can have one of the following string values.

      • Boolean

      • Byte

      • Short

      • Integer

      • Long

      • Float

      • Double

      • String

      • Char

      • ByteArray

    • Use Case 2. A MapMessage entry (name-value pair) is processed as payload.

    The PayloadEntry property specifies that the JMS MapMessage entry name (referring to the name-value pair that should be processed) to be is used as the payload. You have the option to send the payload as an attachment if the AttachmentList property is defined instead of PayloadEntry. For this use case, either PayloadEntry or AttachmentList property should be specified but not both.

    All other MapMessage entries are converted to adapter properties identified by jca.jms.Map.xxxx, where xxxx is name of the JMS MapMessage entry (name-value pair).

  • Supports Enterprise Information System (EIS) credentials

    The Oracle JMS Adapter supports securing of the Enterprise Information System (EIS) credentials such as the user name and password, whenever it establishes an outbound connection with EIS. You can secure the user name and password for Oracle JMS Adapter by using Oracle WebLogic Server container-managed signon.

    For more information about support for securing of the Enterprise Information System (EIS) credentials, see Securing Enterprise Information.

  • Supports streaming large payload

    Oracle JMS Adapter provides support to stream payload. When you enable this feature, the payload is streamed to a database instead of getting manipulated in the SOA runtime as in a memory DOM. This feature can be used while handling large payloads. To enable support to stream payload, ensure that you select the Enable Streaming check box while defining the consume operation parameters on the Consume Operation Parameters page in Oracle JDeveloper. When the Enable Streaming check box is selected, a corresponding Boolean property EnableStreaming is appended to the ActivationSpec properties defined in the respective .jca file, as shown in the following example. If the EnableStreaming property does not exist, then the default value of false is assumed.

    <activation-spec className="oracle.tip.adapter.jms.inbound.
                      JmsConsumeActivationSpec">
      <property name="DestinationName" value="jms/DemoInQueue"/>
      <property name="UseMessageListener" value="false"/>
      <property name="PayloadType" value="TextMessage"/>
      <property name="EnableStreaming" value="true"/>
    </activation-spec>
    
  • Supports transactions

    A transaction enables an application to coordinate a group of messages for production and consumption, treating messages sent or received as a single unit. When an application commits a transaction, all messages it received within the transaction are removed by the JMS provider. The messages it sent within the transaction are delivered as one unit to all JMS consumers. If the application rolls back the transaction, then the messages it received within the transaction are returned to the messaging system and the messages it sent are discarded. The Oracle JMS Adapter supports JMS transactions. A JMS-transacted session supports transactions that are located within the session. A JMS-transacted session's transaction does not have any effects outside of the session.

  • Supports error handling

    For information about error handling, refer to Error Handling.

  • Supports multiple consumer threads

    The Oracle JMS Adapter supports an activation endpoint property, adapter.jms.receive.threads. Setting this property in composite.xml is a preferred way to spawn multiple poller threads for the inbound message flow between the adapter and the Enterprise Information System (EIS). This helps improve performance because multiple poller threads dequeue messages in a round robin fashion; this assists in Distributed scenarios as well.

    Note:

    When resiliency is enabled and Oracle Event Delivery Network (EDN) subscriber is in quiescent mode, the EDN consumer threads enter into sleep mode. Based on the configuration, for example, MaxStuckThreadTime = 600 (seconds), the sleeping EDN consumer threads are marked as STUCK when the configured MaxStuckThreadTime is elapsed. These STUCK logging statements in server log are temporary warnings, and have no functional impact. Once the quiescence mode is over and resiliency resumes incoming request processing, these STUCK warnings vanish, and normal processing is resumed.

    SOA_Request_WM and SOA_EDN_WM also share the same max constraint. When the number of threads of EDN subscribers is larger than the max constraint, it impacts SOA_Request_WM performance. The workaround is either reduce the number of threads of EDN subscribers or increase the max constraint defined by SOAIncomingRequests_maxThreads.

  • Supports performance tuning

    The Oracle JMS Adapter supports performance tuning. For more information, see Oracle JCA Adapter Tuning Guide and Oracle JCA Adapter Properties.

Note:

Oracle JMS Adapter cannot be used programmatically inside an EJB or JMS client.

8.3 Oracle JMS Adapter Concepts

Messaging is any mechanism that enables communication between programs. Messages are structured data that one application sends to another. Message-oriented middleware (MOM) is an infrastructure that supports scalable enterprise messaging. MOM ensures fast, and reliable asynchronous communication, guaranteed message delivery, receipt notification, and transaction control.

JMS is a Java interface developed by Sun Microsystems for producing, sending, and receiving messages of an enterprise messaging system. JMS is an API that JMS vendors implement. Oracle provides two implementations of JMS, WLS JMS and Oracle JMS based on Oracle advanced queues. A JMS producer creates JMS messages and a JMS consumer consumes JMS messages.

JMS supports two messaging paradigms, point-to-point (queues) and publish/subscribe (topics).

8.3.1 Point-to-Point

In point-to-point messaging, the messages are stored in a queue until they are consumed. One or more producers write to the queue and one or more consumers extract messages from the queue. The JMS consumer sends an acknowledgment after consumption of a message; this results in purging of the message from the queue.

8.3.2 Publish/Subscribe

In publish/subscribe messaging, producers publish messages to a topic, and the consumer subscribes to a particular topic. Many publishers can publish to the same topic, and many consumers can subscribe to the same topic. All messages published to the topic by the producers are received by all consumers subscribed to the topic. By default, subscribers receive messages only when the subscribers are active. However, JMS API supports durable subscriptions that ensure that consumers receive messages that were published even when the subscribers are not up and running. The durable subscription involves registering the consumer with a unique ID for retrieving messages that were sent when the consumer was inactive. These messages are persisted by the JMS provider and are either sent to the consumer when it becomes active again or purged from storage if the message expires. The JMS producer can be set either to persistent or nonpersistent mode. The messages are not persisted in the latter case and can be used only for nondurable subscriptions.

For scenarios that require you to work with durable subscriptions on Oracle WebLogic Server, a connection pool with ClientID property defined is required, as shown in the following example:

<FactoryProperties>ClientID=uniquename</FactoryProperties>

When defining multiple durable subscriber it would entail you to define multiple connection pools each with a unique ClientID property specified. You must take care to not use the same connection pool for any other adapter interaction (such as outbound interaction if it is used for processing inbound messages) because Oracle WebLogic Server allows a clientid to be bound only once. For a scenario in which a connection pool with ClientId defined is used on the inbound to process incoming messages a different connection pool should be used for the outbound adapter interactions.

Note:

You must manually remove durable subscribers that are not used. Oracle JMS Adapter does not automatically remove these durable subscriptions. To remove a durable subscriber, use the Weblogic Server Adminstration Console > Services > Messaging > JMS Modules > module name > topic name > Monitoring > Durable Subscribers tab. In the Durable Subscribers list, select the durable subscriber to delete and click Delete.

The JMS API supports both synchronous and asynchronous communication for message consumption. In the synchronous case, the consumer explicitly calls the receive() method on the topic or queue. In the asynchronous case, the JMS client registers a message listener for the topic or queue and the message is delivered by calling the listener's onMessage() method.

8.3.3 Destination, Connection, Connection Factory, and Session

The destination property contains the addressing information for a JMS queue or topic.Connections represent a physical connection to the JMS provider. The connection factory is used to create JMS connections. A session is used to create a destination, JMS producer, and JMS consumer objects for a queue or topic.

8.3.4 Structure of a JMS Message

The JMS message has a mandatory standard header element, an optional properties element, and an optional standard payload element. The payload can be a text message, byte message, map message, stream message, or object message. The properties element is JMS provider-specific and varies from one JMS provider to another.

8.3.5 Oracle JMS Adapter Header Properties

For information about the Oracle JMS Adapter header properties, see Oracle JMS Adapter Properties.

8.3.6 Connecting with Third-Party Service Providers

JMS Adapter can communicate with TIBCO, IBM MQ Series, and other certified third- party Service Providers. If these service providers are stopped and subsequently restarted, the JMS Adapter can successfully connect to them and process any pending messages.

Perform the following steps to ensure connection occurs correctly:

  1. In <SOAInstall_DIR>/user_projects/domains/<DOMAIN_NAME>/bin/setDomainEnv.sh, a startup script for Weblogic Administration server and Weblogic Managed server, locate

    JAVA_OPTIONS="${JAVA_OPTIONS}"

    Change this to

    JAVA_OPTIONS="${JAVA_OPTIONS} -Dweblogic.transaction.blocking.commit=false
    -Dweblogic.transaction.blocking.rollback=false"
  2. In the WebLogic Administration Console, proceed to domain > JTA > Advanced, and set:

    • Abandon Timeout Seconds = 120 seconds
    • (Under Advanced): Completion Timeout: 0 seconds
    • (Under Advanced): Maximum Duration XA Resource Unavailable: 180000 milliseconds.
8.3.6.1 Binding

The adapter.jms.DistributedDestinationConnectionEveryMember property is available as the Service binding property for the JMS Adapter.

This property takes boolean values [true | false]. The default value is true.

When true, the JMS Adapter creates a consumer/subscriber for each member of the distributed destination. If set to false, the JMS Adapter creates a consumer/subscriber for only local members of the distributed destination. When the JMS Adapter is connecting to distributed destination on a remote cluster or a server on remote domain, the adapter.jms.DistributedDestinationConnectionEveryMember property should always be set to true. When the JMS Adapter is connecting to distributed destination on a local cluster, the property can be set to either true or false. If set to true, the JMS Adapter behavior remains the same as before (that is, there is a consumer for each distributed destination is created). If set to false, the JMS Adapter only creates consumer/subscriber for the local members.

You will not see this property in JDeveloper as a binding property on Service side. Consequently, you must manually add it in the composite.xml as shown below under the <service>/<binding.jca> tag:

<property name="adapter.jms.DistributedDestinationConnectionEveryMember" type="xs:string" many="false" override="may">false</property>

8.4 Oracle JMS Adapter Use Cases

The section discusses the following uses cases of Oracle JMS Adapter.

8.4.1 Configuring Oracle JMS Adapter

The following use case demonstrates the procedure for configuring Oracle JMS Adapter and examines the resulting WSDL files and associated weblogic-ra.xml files.

This section includes the following topics:

8.4.1.1 Creating an Application and a SOA Project

You must create an JDeveloper application to contain the SOA composite. To create an application and a SOA project, perform the following steps:

  1. Open JDeveloper.
  2. In the Application Navigator, click New Application.

    The Create Generic Application - Name your Application page is displayed, as shown in Figure 8-1.

  3. Enter a name for the application in the Application Name field. For example, AQQueue2Queue.
  4. In the Application Template list, choose Generic Application.

    Figure 8-1 The Create Generic Application - Name your application Page

    Description of Figure 8-1 follows
    Description of "Figure 8-1 The Create Generic Application - Name your application Page"
  5. Click Next.

    The Name your project dialog is displayed, as shown in Figure 8-2.

  6. In the Project Name field, enter a descriptive name. For example, AQQueue2Queue.
  7. In the Available list in the Project Technologies tab, double-click SOA to move it to the Selected list.

    Figure 8-2 The Create Generic Application - Name your Generic project Page

    Description of Figure 8-2 follows
    Description of "Figure 8-2 The Create Generic Application - Name your Generic project Page"
  8. Click Next.

    The Create Generic Application - Configure SOA settings page is displayed, as shown in Figure 8-3.

    Figure 8-3 The Create Generic Application - Configure SOA Settings Page

    Description of Figure 8-3 follows
    Description of "Figure 8-3 The Create Generic Application - Configure SOA Settings Page"
  9. Select Composite With BPEL from the Composite Template list, and then click Finish.

    You have created a new application, and a SOA project. This automatically creates a SOA composite.

    The Create BPEL Process page is displayed, as shown in Figure 8-4.

    Figure 8-4 The Create BPEL Process Page

    Description of Figure 8-4 follows
    Description of "Figure 8-4 The Create BPEL Process Page"
  10. Enter a name for the BPEL process in the Name field. In this example, use the default name.
  11. Select Define Service Later in the Template list, and then click OK.

    You have created a BPEL process.

8.4.1.2 Using the Adapter Configuration Wizard to Configure Oracle JMS Adapter

To configure an Oracle JMS Adapter using the Adapter Configuration Wizard, perform the following steps:

  1. Drag and drop JMS Adapter from the Service Adapters list to the Exposed Services swim lane in the composite.xml page.

    The Adapter Configuration Wizard is displayed.

  2. Enter a name for the service, and then click Next.

    The JMS Provider page is displayed.

    Figure 8-5 The Adapter Configuration Wizard - JMS Provider Page

    Description of Figure 8-5 follows
    Description of "Figure 8-5 The Adapter Configuration Wizard - JMS Provider Page"
  3. Select any one operation. In this example, select Oracle Weblogic JMS.
    • Oracle Enterprise Messaging Service (OEMS): This enables you to integrate with the WebLogic service or Advanced Queueing messaging service.

    • Third Party: Select this option to integrate with a third-party provider.

  4. Click Next.

    The Adapter Configuration Wizard - Service Connection page is displayed.

  5. You must establish connectivity between the design-time environment and the server you want to deploy it to.

    Perform the steps mentioned in Creating an Application Server Connection for Oracle JCA Adapters to create an application server connection.

  6. Click Next. The Adapter Interface page is displayed.
  7. In the Adapter Interface page, select Define from operation and schema (specified later).

    Figure 8-6 The Adapter Configuration Wizard - Adapter Interface Page

    Description of Figure 8-6 follows
    Description of "Figure 8-6 The Adapter Configuration Wizard - Adapter Interface Page"
  8. Click Next.

    The Adapter Configuration Wizard- Operation page is displayed.

  9. Select Consume Message, Produce Message, or Request/Reply, or Synchronous Consume a Message. In this example, select Consume Message.

    The operation name is filled in automatically.

    Figure 8-7 The Adapter Configuration Wizard - Operation Page

    Description of Figure 8-7 follows
    Description of "Figure 8-7 The Adapter Configuration Wizard - Operation Page"

    The Consume Message option enables the adapter to consume (receive) inbound messages from a JMS destination.

  10. Click Next.

    The Consume Operation Parameters page is displayed.

    Figure 8-8 The Adapter Configuration Wizard - Consume Operation Parameters Page

    Description of Figure 8-8 follows
    Description of "Figure 8-8 The Adapter Configuration Wizard - Consume Operation Parameters Page"
  11. Enter values for the following fields:
    • Destination Name

      This is the JNDI name of the JMS queue or topic from which to receive the message. This is not an editable field. You must click Browse to browse for the queue or topic. The queue or topic to be chosen is based on the type of JMS provider you are using.

      For more information, see the following sections:

    • Message Body Type

      The supported values are TextMessage, BytesMessage, MapMessage. The StreamMessage message type is not supported in this release.

    • Durable Subscriber ID

      This field is optional. If you are setting up a durable subscriber, then the durable subscriber ID is required. Generally, a subscriber loses messages if the subscriber becomes disconnected, but a durable subscriber downloads stored messages when it reconnects.

      Note:

      When the JMS provider is Oracle WebLogic JMS or Oracle Advanced queueing messaging service, then the Durable Subscriber option appears only when a topic is selected. However, the Durable Subscriber option always appears when the JMS provider is a third-party.

    • Message Selector

      This field is also optional. It filters messages based on header and property information. The message selector rule is a Boolean expression. If the expression is true, then the message is consumed. If the expression is false, then the message is rejected.

      For example, you can enter logic, such as:

      • JMSPriority > 3. Based on this, messages with a priority greater than 3 are consumed; all other messages are rejected.

      • JMSType = 'car' AND color = 'blue' AND weight > 2500

      • Country in ('UK', 'US', 'France')

    • Use MessageListener

      This field is always set to False by default.

    • JNDI Name

      The value specified in the JNDI name should exist in the Oracle JMS Adapter weblogic-ra.xml file to ensure that the adapter runs in managed mode.

    Note:

    This example shows a consume message operation. For a produce message operation, this page is different. See Produce Message Procedure to see how this part of the procedure differs.

    After you enter the appropriate parameters, click Next.

  12. Messages page is displayed. The settings in this page define the correct schema for the message payload.

    You can perform one of the following:

    • Check Native format translation is not required (Schema is Opaque), which disables the rest of the fields.

    • Click Define Schema for Native Format to start the Native Format Builder wizard, which guides you through the process of defining the native format.

    • Enter the path for the schema file URL (or browse for the path).

    The following steps demonstrate the last option: browsing for the schema file URL.

    Figure 8-9 The Adapter Configuration Wizard - Messages Page

    Description of Figure 8-9 follows
    Description of "Figure 8-9 The Adapter Configuration Wizard - Messages Page"
  13. Click the Browse button.

    The Type Chooser dialog is displayed, with the Type Explorer navigation tree.

  14. Browse the tree and select the appropriate schema type, and then click OK.

    Figure 8-10 Selecting a Schema from the Type Chooser Dialog

    Description of Figure 8-10 follows
    Description of "Figure 8-10 Selecting a Schema from the Type Chooser Dialog"

    The Messages page is displayed again, this time with the Schema File URL field and the Schema Element field filled up.

    Figure 8-11 Completed Messages Dialog

    Description of Figure 8-11 follows
    Description of "Figure 8-11 Completed Messages Dialog"
  15. Click Next. The JCA Endpoint Properties screen is displayed.
    The JCA Endpoint Properties screen appears for inbound if you have selected Reference Configuration option. For more information, see JCA Endpoint Properties in the Adapter Configuration Wizard.
  16. Click Next.

    The Finish page is displayed. This box shows the path and name of the adapter file that the wizard creates.

  17. Click Finish.

    The composite.xml page is displayed.

8.4.1.3 Generated Files

The following composite file is generated by the Adapter Configuration Wizard:

<composite name="AQQueue2Queue"revision="1.0"
           label="2007-09-04_11-58-50_914"mode="active"state="on"
           xmlns="http://xmlns.oracle.com/sca/1.0"           xmlns:xs="http://www.w3.org/2001/XMLSchema"           xmlns:wsp="http://schemas.xmlsoap.org/ws/2004/09/policy"           xmlns:orawsp="http://schemas.oracle.com
                 /ws/2006/01/policy">
  <import namespace="http://xmlns.oracle.com/pcbpel/adapter
               /jms/Inbound/"location="Inbound.wsdl"
               importType="wsdl"/>
  <import namespace="http://xmlns.oracle.com/pcbpel/
               adapter/jms/Outbound/"location="Outbound.wsdl"
              importType="wsdl"/>
  <service name="Inbound">
    <interface.wsdl interface="http://xmlns.oracle.com/pcbpel/
          adapter/jms/Inbound/#wsdl.interface 
            (Consume_Message_ptt)"/>
    <binding.jca config="Inbound_jms.jca"/>
  </service>
  <component name="BPELProcess1">
    <implementation.bpel src="BPELProcess1.bpel"/>
  </component>
  <reference name="Outbound">
    <interface.wsdl interface=
                "http://xmlns.oracle.com/pcbpel/adapter
                /jms/Outbound/#wsdl.interface (Produce_Message_ptt)"/>
    <binding.jca config="Outbound_jms.jca"/>
  </reference>
  <wire>
    <source.uri>Inbound</source.uri>
    <target.uri>BPELProcess1/Inbound</target.uri>
  </wire>
  <wire>
    <source.uri>BPELProcess1/Outbound</source.uri>
    <target.uri>Outbound</target.uri>
  </wire>
</composite>

The following code segment defines the name of the adapter and the locations of various necessary schemas and other definition files.

 <import namespace="http://xmlns.oracle.com/pcbpel
          /adapter/jms/Inbound/"location="Inbound.wsdl"
                 importType="wsdl"/>
  <import namespace="http://xmlns.oracle.com
                   /pcbpel/adapter/jms/Outbound/"location=
                   "Outbound.wsdl" importType="wsdl"/>

This code segment imports the necessary namespace.

<definitions name="Inbound" targetNamespace="http://xmlns.oracle.com/pcbpel/adapter/jms/Inbound/" xmlns="http://schemas.xmlsoap.org/wsdl/" xmlns:tns="http://xmlns.oracle.com/pcbpel/adapter/jms/Inbound/" xmlns:plt="http://schemas.xmlsoap.org/ws/2003/05/partner-link/" xmlns:imp1="http://xmlns.oracle.com/pcbpel/samples/expense">
    <types>
        <schema xmlns="http://www.w3.org/2001/XMLSchema">
            <import namespace="http://xmlns.oracle.com/pcbpel/samples/expense" schemaLocation="xsd/expense.xsd"/>
        </schema>
    </types>
    <message name="ExpenseRecord_msg">
        <part name="ExpenseRecord" element="imp1:ExpenseRecord"/>
    </message>
    <portType name="Consume_Message_ptt">
        <operation name="Consume_Message">
            <input message="tns:ExpenseRecord_msg"/>
        </operation>
    </portType>

This code segment defines the message type, name, and the port type for the partner link.

<adapter-config name="dequeue" adapter="Jms Adapter   xmlns="http://platform.integration.oracle/blocks/adapter/fw/metadata">
  <connection-factory location="eis/wls/Queue" UIConnectionName="wls3"   
UIJmsProvider="WLSJMS" adapterRef=""/>
  <endpoint-activation portType="Consume_Message_ptt" operation="Consume_
Message">
    <activation-spec 
className="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec">
      <property name="DestinationName" value="jms/DemoInQueue"/>
      <property name="UseMessageListener" value="false"/>
      <property name="PayloadType" value="TextMessage"/>
    </activation-spec>
  </endpoint-activation>
</adapter-config>
8.4.1.4 weblogic-ra.xml file

The weblogic-ra.xml file defines the endpoints for the JMS connection factories. The connection factories include configuration properties for each endpoint. Endpoints are added to accommodate different types of connections, as demonstrated in the following sections. The following example is from the generic weblogic-ra.xml file:

<connection-instance>    
  <jndi-name>eis/wls/Queue</jndi-name>
    <connection-properties>
       <properties>
           <property>
               <name>ConnectionFactoryLocation</name>
               <value>weblogic.jms.XAConnectionFactory</value>
           </property>
           <property>
               <name>FactoryProperties</name>
               <value></value>
           </property>
           <property>
               <name>AcknowledgeMode</name>
               <value>AUTO_ACKNOWLEDGE</value>
           </property>
           <property>
              <name>IsTopic</name>
              <value>false</value>
           </property>
           <property>
               <name>IsTransacted</name>
               <value>false</value>
           </property>
           <property>
               <name>Username</name>
               <value></value>
           </property>
           <property>
               <name>Password</name>
               <value></value>
           </property>
           </properties>
      </connection-properties>
</connection-instance>

Note:

In general, when XAConnectionFactory is used and when XA transaction is enabled, the isTransacted property should be set to false so that transactions are handled by the WebLogic Transaction Manager instead of the JMS Adapter. If the isTransacted property is set to true, the JMS Adapter will perform a transaction commit at the end of a transaction, which works only when non-XA transactions are involved.
8.4.1.4.1 Creating a New Connection by Using the Oracle WebLogic Server Administration Console

You can also create a new connection by using the Oracle WebLogic Server Administration Console. The following are the steps for creating a new connection by using the Oracle WebLogic Server Administration Console:

  1. Navigate to the Oracle WebLogic Server Administration Console: http://servername:portnumber/console.
  2. Use the required credentials to open the Home page of the Oracle WebLogic Server Administration Console.

    The Home page of the Oracle WebLogic Server Administration Console is displayed.

  3. Select Deployments in the Domain Structure pane.

    The Oracle WebLogic Server Administration Console - Summary of Deployments page is displayed.

  4. Under Deployments, click any JMS adapter that you have deployed. For example, click JmsAdapter.

    The Oracle WebLogic Server Administration Console - Settings for JmsAdapter page is displayed.

  5. Click the Configuration tab, and then click the Outbound Connection Pools tab.

    The Outbound Connection Pool Configuration Table is displayed.

  6. Click Next.

    The Create a New Outbound Connection page is displayed.

  7. Select the default outbound connection group, and then click Next.
  8. Click Next.
  9. In the JNDI Name field, enter the JNDI name that you want to use to obtain the new connection instance. For example, eis/wls/Queue.

    You can specify any name for the JNDI field. However, you must ensure that you use the same JNDI name while defining the consume or produce operation parameters in JDeveloper.

  10. Click Finish.

    The Save Deployment Plan Assistant page is displayed.

    The configuration changes that you made must be stored in a new deployment plan.

  11. In the Path field, select or enter the path of a deployment plan file. The path must end with '.xml'.
  12. Click OK.

    You have created a new connection. After you have done this, you must verify whether the properties you have created are correct.

  13. In the Settings for JmsAdapter page, click the Configuration tab, and then click the Properties tab.

    The connection that you created is listed in this page. Verify whether this value is correct. For example, if you are connecting to a third-party JMS server, then ensure that the Connection Factory Location field has the correct value applicable for a third-party JMS server.

    Note:

    In this example, you created a new connection for Oracle JMS Adapter by using the Oracle WebLogic Server Administration Console. To create connection for other adapters, you must follow the same steps. However, ensure that you select the appropriate adapter for which you want to create a connection in Step 4.

  14. Click Save.
8.4.1.4.2 Adding a Third-Party JMS Provider

You can specify that the adapter use a third-party JMS Provider for non-Web Logic Server JMS and non-AQJMS connection instances, by supplying a value to the FactoryProperties parameter in the weblogic-ra.xml file. Specifically, you can provide the ThirdPartyJMSProvider value to the FactoryProperties parameter. This property is required only when you deploy an adapter to the WebLogic Server.

When this value is set to true, the JMS Adapter does not use DestinationAvailabilityListener for creating consumers for processing of JMS messages. The default is false. You must ensure you employ code similar to the following snippet:

<property>
    <name>FactoryProperties</name>
    <value>ThirdPartyJMSProvider=true</value>
</property> 

Note:

All pre-populated connection instances on a WebLogic Server reflect the change and consequently, no further tuning is required for those instances. Only when a new non WLS JMS or AQJMS provider access is required do you must add new a connection instance and therefore the ThirdPartyJMSProvider property.

8.4.1.5 Produce Message Procedure

A produce message operation has certain differences in the definition procedure, particularly in Step 13 of Using the Adapter Configuration Wizard to Configure . Instead of specifying consume operation parameters, you specify the following produce operation parameters. This enables the adapter to produce (send) outbound messages for a JMS destination. The Produce Operation Parameters page is shown in Figure 8-12.

  • Destination Name:

    The JNDI name of the JMS queue or topic to which the message must be delivered. The name to enter is based on the type of JMS provider you use.

    For more information about destination name, see the following:

  • Message Body Type:

    The supported values are TextMessage, BytesMessage, and MapMessage. StreamMessage is not supported in this release.

  • Delivery Mode:

    The values are Persistent or Nonpersistent. A persistent delivery mode specifies a persistent JMS publisher; that is, a publisher that stores messages for later use by a durable subscriber. A durable subscriber is a consume message with a durable subscriber ID in the corresponding field in Step 15 of Using the Adapter Configuration Wizard to Configure . A nondurable subscriber loses any messages that are produced when the adapter is not active. A durable subscriber downloads messages that have been stored in the persistent publisher, and therefore does not have to remain active at all time to receive all the messages.

  • Priority:

    Select a priority value, with 9 representing the highest priority and 0 representing the lowest priority. The default is 4.

  • TimeToLive:

    The amount of time before the message expires and is no longer available to be consumed.

  • Unit Of Order

    This parameter only applies when the selected JMS Provider is a WebLogic Server JMS provider. It enables a message producer or group of message producers acting as one, to group messages into a single unit that is processed sequentially in the order the messages were created. The message processing of a single message is complete when a message is acknowledged, committed, recovered, or rolled back. Until message processing for a message is complete, the remaining unprocessed messages for that Unit of Order are blocked. The UnitOfOrder property enables you to set the unit-of-order value for the MessageProducer when producing a message. Refer to the Use Case Using the WLS JMS Unit-Of-Order with the JMS Adapter and Using Message Unit-of-Order in Developing JMS Applications for Oracle WebLogic Server.

  • JNDI Name

    This field enables you to specify the JNDI name for the JMS connection. The deployment descriptor for the deployed instance of the JMS Adapter must associate this JNDI name with a set of configuration properties required by the JMS Adapter to access the JNDI destination at runtime.

Figure 8-12 Produce Operation Parameters Page

Description of Figure 8-12 follows
Description of "Figure 8-12 Produce Operation Parameters Page"

8.4.2 Configuring the Oracle JMS Adapter with TIBCO JMS

This section describes how to configure Oracle JMS Adapter with Tibco JMS for direct connection and non direct connection.

Note:

Read the entire section before making configuration changes, as not all information is available in each subsection. Information related to TIBCO Enterprise Message Service is based on TIBCO Enterprise Message Service User's Guide, Software Release 6.3, February 2012. Refer to TIBCO's documents for latest updates.

Also, note that in the following discussion EMS_HOME stands for Tibco Enterprise Message Service installation directory.

8.4.2.1 Using Preconfigured Tibco Connection Factory for non-SSL Connections

Use the TIBCO Enterprise Message Service Administration Tool to create a connection factory and queue/topic.

  1. For example,
    create factory QueueConnectionFactory queue url=tcp://localhost:7222 
    create queue TibcoQueue 
    
  2. Open the Weblogic Administration Console to modify an existing connection pool for connection to a Tibco Server. Navigate to Deployment->JmsAdapter->Configuration-> oracle.tip.adapter.jms.IJmsConnectionFactory->Outbound Connection Pools->eis/tibjms/Queue
  3. Set the ConnectionFactoryLocation to QueueConnectionFactory. This is the name of the connection factory created earlier using TIBCO Enterprise Message Service Administration Tool.
  4. Set the FactoryProperties to the following (separated into multiple lines for easier reading):
    java.naming.factory.initial=com.tibco.tibjms.naming.   TibjmsInitialContextFactory; 
    java.naming.provider.url=tibjmsnaming://localhost:7222; 
    java.naming.security.principal=<user name on Tibco server>; 
    java.naming.security.credentials=<password>; 
      ThirdPartyJMSProvider=true 
    
  5. You can also create your own connection pool by modifying the weblogic-ra.xml file in AS11gR1SOA/soa/connectors/JmsAdapter.rar as shown in the example below. (You can use this as an example for creating a Topic connection pool, also):

    Example - Creating Your Own Connection Pool

    <connection-instance> 
         <jndi-name>eis/tibjms/QueueConnectionPool</jndi-name> 
             <connection-properties> 
                 <properties> 
                     <property> 
                         <name>ConnectionFactoryLocation</name> 
                         <value>QueueConnectionFactory</value> 
                     </property> 
                     <property> 
                         <name>FactoryProperties</name> 
                         <value>java.naming.factory.initial=com.
                              tibco.tibjms.naming.
                              TibjmsInitialContextFactory;
                                java.naming.provider.
                                     url=tibjmsnaming://localhost:7222;
                                        java.naming
                                 .security.principal=<user name on
                                            Tibco server>;
                                 java.naming.security.credentials=
                                            <password>;
                                     ThirdPartyJMSProvider=true 
                             </value> 
                         </property> 
                         <property> 
                         <name>AcknowledgeMode</name> 
                         <value>AUTO_ACKNOWLEDGE</value> 
                     </property> 
                     <property> 
                         <name>IsTopic</name> 
                         <value>false</value> 
                     </property> 
                     <property> 
                         <name>IsTransacted</name> 
                         <value>true</value> 
                     </property> 
                     <property> 
                         <name>Username</name> 
                         <value></value> 
                     </property> 
                     <property> 
                         <name>Password</name> 
                         <value></value> 
                     </property> 
                 </properties> 
             </connection-properties> 
     </connection-instance> 
     
  6. Update the JMSAdapter connection pool deployment after making these changes. Copy EMS_HOME/lib/tibjms.jar to the <SOA Installation>/user_projects/domains/<DOMAIN_NAME>/lib directory. Restart the Weblogic Server.
  7. In the project you deploy, the JMS jca file for the JMS adapter might look like the following. Note that the value of DestinationName is TibcoQueue which is the queue created using TIBCO Enterprise Message Service Administration Tool.
    <connection-factory UIJmsProvider="THIRDPARTY" 
                              location="eis/tibjms/Queue" 
                          UIConnectionName="SOADEV"/> 
      <endpoint-interaction portType="Produce_Message_ptt" 
                         operation="Produce_Message"> 
         <interaction-spec 
           className="oracle.tip.adapter.jms.                  outbound.JmsProduceInteractionSpec"> 
           <property name="TimeToLive" value="0"/> 
           <property name="PayloadType" value="TextMessage"/> 
           <property name="DeliveryMode" value="Persistent"/> 
           <property name="DestinationName" value="TibcoQueue"/> 
         </interaction-spec> 
       </endpoint-interaction> 
    
  8. After messages are published, you can use the TIBCO Enterprise Message Service Administration Tool to verify the number of messages in a Tibco queue, for example:
    show queue TibcoQueue 
      Queue:                 TibcoQueue 
      Type:                  static 
      Properties:            *prefetch=5 
      JNDI Names:            <none> 
      Bridges:               <none> 
      Receivers:             0 
      Pending Msgs:          2, (2 persistent) 
      Delivered Msgs:        0 
      Pending Msgs Size:     1.2 Kb, (1.2 Kb persistent)
     
8.4.2.2 Using Dynamically Created Tibco Connection Factory for non-SSL Connections

A preconfigured connection factory is often the preferred mechanism; however, Tibco does provide support for dynamically created connection factories. To use these,

  1. Use the TIBCO Enterprise Message Service Administration Tool to create a queue or topic.
    create queue TibcoQueue
    
  2. Set the ConnectionFactoryLocation to com.tibco.tibjms.TibjmsQueueConnectionFactory.
  3. Set the FactoryProperties to ServerUrl=tcp://<HOST>:<PORT>;UserName=<USERNAME>;UserPassword=<PASSWORD>
  4. If the Tibco server does not require a user name and password to connect remove the user name and password fields.
  5. Save and update the JMS Adapter connection pool deployment.
  6. Copy EMS_HOME/lib/tibjms.jar and EMS_HOME/lib/jms-2.0.jar to <SOA Installation>/user_projects/domains/<DOMAIN_NAME>/lib directory.
  7. Restart the managed Weblogic Server.
  8. In the project to be deployed, the JMS jca file for the JMS Adapter might look like the following example.

    Note that value of DestinationName is TibcoQueue, which is the queue created using TIBCO Enterprise Message Service Administration Tool.

    Example - JMS jca File for JMS Adapter with Dynamically-Created Connection Factory

     <connection-factory UIJmsProvider="THIRDPARTY" 
     location="eis/tibjmsDirect/Queue" UIConnectionName="SOADEV"/> 
      <endpoint-interaction portType="Produce_Message_ptt" 
     operation="Produce_Message"> 
         <interaction-spec 
     className="oracle.tip.adapter.jms.outbound.JmsProduceInteractionSpec"> 
           <property name="TimeToLive" value="0"/> 
           <property name="PayloadType" value="TextMessage"/> 
           <property name="DeliveryMode" value="Persistent"/> 
           <property name="DestinationName" value="TibcoQueue"/> 
         </interaction-spec> 
       </endpoint-interaction> 
    
8.4.2.3 Using a Preconfigured Tibco Connection Factory for SSL Connections

You can use a pre-configured Tibco Connection Factory for SSL Connections. To so, you must configure the Tibco server to support SSL.

  1. Create a certs directory under EMS_HOME/bin.
  2. Copy server SSL certificates to the EMS_HOME/bin/certs directory. Tibco supplies, for the purposes of testing, a self-signed server certificate and private keys which you can find in EMS_HOME\bin\samples\certs.
  3. In EMS_HOME/bin/tibemsd.conf, add the following lines:
        listen = ssl://localhost:7243 
        ssl_server_identity = certs/server.cert.pem 
        ssl_server_key = certs/server.key.pem 
        ssl_password = password 
        listen = tcp://localhost:7222 
    

    These lines explicitly set the TCP and SSL listen ports and specify the three required server-side SSL parameters: identity, private key, and password.

  4. Save the file and stop the TIBCO Enterprise Message Service server.
  5. Start the TIBCO EMS server with the -ssl_debug_trace option: tibemsd -ssl_debug_trace.
  6. Verify server is listening on the SSL port in server console
     2014-04-29 16:14:20.997 Secure Socket Layer is enabled, using OpenSSL 0.9.8y5 
     Feb 2013 
     2014-04-29 16:14:20.998 Accepting connections on ssl://localhost/[::]:7243. 
     2014-04-29 16:14:20.998 Accepting connections on 
     ssl://localhost/0.0.0.0:7243. 
     2014-04-29 16:14:20.998 Accepting connections on tcp://localhost/[::]:7222. 
     2014-04-29 16:14:20.998 Accepting connections on 
     tcp://localhost/0.0.0.0:7222. 
    
  7. Use the TIBCO Enterprise Message Service Administration Tool to create an SSL ConnectionFactory, disable host verification (do not disable host verification if you want to verify the client host), and create a queue:
     create factory SSLQueueConnectionFactory queue url=ssl://localhost:7243 
     setprop factory SSLQueueConnectionFactory ssl_verify_host=disabled 
     create queue TibcoQueue 
    
  8. Open the Weblogic Administration Console to modify an existing connection pool for connection to Tibco Server. Navigate to Deployment->JmsAdapter->Configuration-> oracle.tip.adapter.jms.IJmsConnectionFactory->Outbound Connection Pools->eis/tibjms/Queue.
  9. Set the ConnectionFactoryLocation to SSLQueueConnectionFactory. This is the name of the connection factory you created earlier using the TIBCO Enterprise Message Service Administration Tool.
  10. Set the FactoryProperties to (separated into multiple lines for easy reading):
    java.naming.factory.initial=com.tibco.tibjms.naming.     TibjmsInitialContextFactory; 
     java.naming.provider.url=tibjmsnaming://localhost:7243; 
     java.naming.security.principal=<user name on Tibco server>; 
     java.naming.security.credentials=<password>;ThirdPartyJMSProvider=true; 
     com.tibco.tibjms.naming.security_protocol=ssl; 
     com.tibco.tibjms.naming.ssl_enable_verify_host=false; 
     com.tibco.tibjms.naming.ssl_vendor=j2se-default 
     
  11. This enables the client to connect without a certificate. Save and update the deployed connection pool.
  12. Copy the following jar files located in EMS_HOME\lib to <SOA Installation>/user_projects/domains/<DOMAIN_NAME>/lib directory:
    tibcrypt.jar 
    slf4j-api-1.4.2.jar 
    slf4j-simple-1.4.2.jar 
    tibjms.jar 
    
  13. Restart Weblogic Server.
  14. In the project to be deployed, the JMS jca file for the JMS adapter might look like the following example.

    Notice that value of DestinationName is TibcoQueue which is the queue created using TIBCO Enterprise Message Service Administration Tool.

    Example - JMS jca File for Prefconfigured TIBCO Connection Factory Scenario

    <connection-factory UIJmsProvider="THIRDPARTY" location="eis/tibjms/Queue" 
               UIConnectionName="SOADEV"/> 
      <endpoint-interaction portType="Produce_Message_ptt" 
           operation="Produce_Message"> 
         <interaction-spec 
             className="oracle.tip.adapter.jms.outbound.JmsProduceInteractionSpec"> 
           <property name="TimeToLive" value="0"/> 
           <property name="PayloadType" value="TextMessage"/> 
           <property name="DeliveryMode" value="Persistent"/> 
           <property name="DestinationName" value="TibcoQueue"/> 
         </interaction-spec> 
       </endpoint-interaction> 
    
  15. To enable client certificate verification, you must modify EMS_HOME\bin\tibemsd.conf to add the CA certificate which was used to sign the client certificate, for example: ssl_server_trusted = certs/test_client_ca.pem, where test_client_ca.pem is a Tibco-supplied test CA certificate used to sign client certificate test_client_identity.p12. Both files can be found in EMS_HOME\bin\samples\certs. The modified EMS_HOME\bin\tibemsd.conf now looks like the following:
    listen = ssl://localhost:7243 
     ssl_server_identity = certs/server.cert.pem 
     ssl_server_key = certs/server.key.pem 
     ssl_password = password 
     ssl_server_ciphers = all 
     ssl_server_trusted = certs/test_client_ca.pem 
     listen = tcp://localhost:7222 
    
  16. Start the TIBCO EMS server with the -ssl_debug_trace option: tibemsd -ssl_debug_trace
  17. Modify the FactoryProperties (separated into multiple lines for easy reading):
    java.naming.factory.initial=com.tibco.tibjms.naming.   TibjmsInitialContextFactory; 
     java.naming.provider.url=tibjmsnaming://localhost:7243; 
     java.naming.security.principal=<user name on Tibco server>; 
     java.naming.security.credentials=<password>; 
     ThirdPartyJMSProvider=true; 
     com.tibco.tibjms.naming.security_protocol=ssl; 
     com.tibco.tibjms.naming.ssl_enable_verify_host=false; 
     com.tibco.tibjms.naming.ssl_vendor=j2se-default; 
     com.tibco.tibjms.naming.ssl_identity=<EMS_HOME>/bin/certs/     test_client_identity.p12; 
     com.tibco.tibjms.naming.ssl_trusted=<EMS_HOME>/bin/certs/test_client_ca.pem; 
     com.tibco.tibjms.naming.ssl_ciphers=all
     
  18. With these changes, the client can connect to the server with a certificate as shown in the server console:
     2014-04-30 13:39:47.485 Peer certificate: 
     2014-04-30 13:39:47.485 Certificate=[/C=US/ST=California/L=us-english/O=Test 
     Company/OU=test_client 
     Unit/CN=test_client/emailAddress=test_clienttestcompany.com] 
     Issuer=[/C=US/ST=California/L=us-english/O=Test Company/OU=test_client_root 
     Unit/CN=test_client_root/emailAddress=test_client_roottestcompany.com] 
     2014-04-30 13:39:47.485 Peer certificate chain: 
     2014-04-30 13:39:47.485 Certificate=[/C=US/ST=California/L=us-english/O=Test 
     Company/OU=test_client_root 
     Unit/CN=test_client_root/emailAddress=test_client_roottestcompany.com] 
     Issuer=[/C=US/ST=California/L=us-english/O=Test Company/OU=test_client_root 
     Unit/CN=test_client_root/emailAddress=test_client_roottestcompany.com] 
     2014-04-30 13:39:47.485 SSL accepted cipher=RC4-SHA 
    
  19. To limit the server to accept SSL connections only, add the following to EMS_HOME\bin\tibemsd.conf:
     ssl_require_client_cert = enable 
    
8.4.2.4 Using Dynamically Created Tibco Connection Factory for SSL Connections

The Oracle JMS Adapter currently does not support this feature.

8.4.3 Configuring Oracle JMS Adapter with IBM WebSphere MQ JMS

This section describes how to configure Oracle JMS Adapter with IBM WebSphere MQ JMS for non-XA and XA data sources.

8.4.3.1 Non-XA Data Sources

Perform the following steps:

  1. Copy the following files to the <SOAInstall_DIR>/user_projects/domains/<DOMAIN_NAME>/lib folder:
    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/com.ibm.mq.jar

    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/com.ibm.mqjms.jar

    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/dhbcore.jar

    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/com.ibm.mq.jmqi.jar

  2. Configure the connector factory by modifying the weblogic-ra.xml file in AS11gR1SOA/soa/connectors/JmsAdapter.rar, as shown in the following example:
    <connection-instance>
    <jndi-name>eis/webspheremq/Queue</jndi-name>
       <connection-properties>
          <properties>
             <property>
               <name>ConnectionFactoryLocation</name>
               <value>com.ibm.mq.jms.
                    MQQueueConnectionFactory</value>
             </property>
             <property>
                <name>FactoryProperties</name>
                <value>QueueManager=<QUEUEMANAGER>;
                        TransportType=1;HostName= 
                   <YOUR-HOST>;Port=<YOUR-PORT>;Channel=<CHANNEL>;
                      ThirdPartyJMSProvider=true      
    </value>
              </property>
              <property>
                  <name>AcknowledgeMode</name>
                  <value>AUTO_ACKNOWLEDGE</value>
              </property>
              <property>
                 <name>IsTopic</name>
                 <value>false</value>
              </property>
              <property>
                 <name>IsTransacted</name>
                 <value>true</value>
             </property>
             <property>
                 <name>Username</name>
                 <value><USERNAME></value>
             </property>
             <property>
                <name>Password</name>
                <value><PASSWORD></value>
            </property>
            </properties>
        </connection-properties>
    </connection-instance>
    

    Note that the default <USERNAME> and <PASSWORD> are MUSR_MQADMIN and password, respectively.

    Alternatively, to configure a new connection factory by using the Oracle WebLogic Server Administration Console, use the steps mentioned in Adding an Adapter Connection Factory.

8.4.3.1.1 Using a Multi-Instance Queue Manager

You can configure the JMS Adapter to connect with IBM WebSphere MQ JMS and to use a Multi-Instance Queue Manager.

To do so, use a custom property called connectionNameList. You can use this property to specify the names and ports of the different instances.

QueueManager=QM1;TransportType=1;
ConnectionNameList=slj01aml.us.domain.com(141
4),acb113114.us.domain.com(1414);
Channel=SYSTEM.DEF.SVRCONN;ThirdPartyJMSProv
ider=true;ClientReconnectOptions=0 
8.4.3.2 XA Data Sources

Perform the following steps:

  1. Copy the following files to the <SOAInstall_DIR>/user_projects/domains/<DOMAIN_NAME>/lib folder:
    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/com.ibm.mq.jar

    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/com.ibm.mqjms.jar

    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/dhbcore.jar

    • /<YOUR-MQSERIES-INSTALL-LOCATION>/java/lib/com.ibm.mq.jmqi.jar

    • com.ibm.mqetclient.jar

      This IBM-extended transactional client (com.ibm.mqetclient.jar) is required for MQ Series versions prior to version 7. Since version 7 of IBM MQ Series, this com.ibm.mqetclient.jar JAR file is not required to perform XA transactions. XA transactions work acceptably without this JAR file.

  2. Configure the connector factory by modifying the weblogic-ra.xml file in AS11gR1SOA/soa/connectors/JmsAdapter.rar, as shown in the following example:
    <connection-instance>
    <jndi-name>eis/webspheremq/Queue</jndi-name>
       <connection-properties>
            <properties>
               <property>
                  <name>ConnectionFactoryLocation</name>
                  <value>com.ibm.mq.jms.                    MQXAQueueConnectionFactory</value>
               </property>
               <property>
                  <name>FactoryProperties</name>
                  <value>QueueManager=<QUEUEMANAGER>;                  TransportType=1; 
                     HostName=<YOUR-HOST>;
                           Port=<YOUR-PORT>;                  Channel=<CHANNEL>;    |            
                           ThirdPartyJMSProvider
                                  =true</value>
               </property
               <property>
                 <name>AcknowledgeMode</name>
                 <value>AUTO_ACKNOWLEDGE</value>
               </property>
               <property>
                 <name>IsTopic</name>
                 <value>false</value>
               </property
               <property>
                  <name>IsTransacted</name
                  <value>false</value>
               </property
               <property>
                  <name>Username</name>
                  <value><USERNAME></value>
               </property>
               <property>
                  <name>Password</name>
                  <value><PASSWORD></value>
                </property>
             </properties>
        </connection-properties>
    </connection-instance>
    

    Note that the default <USERNAME> and <PASSWORD> are MUSR_MQADMIN and password, respectively.

    Alternatively, to configure a new connection factory by using the Oracle WebLogic Server Administration Console, use the steps mentioned in Adding an Adapter Connection Factory.

8.4.4 Configuring Oracle JMS Adapter with Active MQ JMS

To configure the Oracle JMS Adapter with Active MQ JMS (non-XA only):

  1. Copy the following files to the SOA_install_dir/user_projects/domains/DOMAIN_NAME/lib folder:

    /YOUR-ACTIVEMQ-INSTALL-LOCATION//activemq-all-5.8.0.jar

  2. Configure the connector factory by modifying the weblogic-ra.xml file in AS11gR1SOA/soa/connectors/JmsAdapter.rar as shown in the following example:
    <connection-instance>
          <jndi-name>eis/activemq/Queue</jndi-name>
          <connection-properties>
          <properties>
                <property>
                      <name>ConnectionFactoryLocation</name>
                      <value>org.apache.activemq.
                             ActiveMQConnectionFactory</value>
                </property>
                <property>
                      <name>FactoryProperties</name>
                      <value>BrokerURL=tcp://YOUR-HOST:
                      YOUR-PORT;ThirdPartyJMSProvider=true</value>
                </property>
                <property>
                      <name>AcknowledgeMode</name>
                      <value>AUTO_ACKNOWLEDGE</value>
                </property>
                <property>
                      <name>IsTopic</name>
                      <value>false</value>
                </property>
                <property>
                      <name>IsTransacted</name>
                       <value>true</value>
                </property>
                <property>
                      <name>Username</name>
                      <value></value>
               </property>
               <property>
                     <name>Password</name>
                     <value></value>
                </property>
          </properties>
          </connection-properties>
    </connection-instance>
    

Alternatively, to configure a new connection factory using the Oracle WebLogic Server Administration Console, see Adding an Adapter Connection Factory.

For ActiveMQ Series v5.8, there is XA support and the Connection Factory to be configured for XA is org.apache.activemq.ActiveMQXAConnectionFactory. This has been certified with the current release of the JMS Adapter. The IsTransacted property should be set to false if XA Connection Factory org.apache.activemq.ActiveMQXAConnectionFactory is used.

8.4.5 WebLogic Server JMS Text Message

This WebLogic Server JMS text message use case for Oracle BPEL PM demonstrates how the Oracle JMS Adapter dequeues from and enqueues to the WebLogic Server JMS Queue.

This section includes the following topics:

8.4.5.1 Prerequisites

You must complete the following prerequisites for the WebLogic Server JMS text message use case for Oracle BPEL PM.

8.4.5.1.1 Creating Queues in the Oracle WebLogic Server Administration Console:

Perform the following steps to create queues required for this use case:

  1. Navigate to the Oracle WebLogic Server Administration Console: http://servername:portnumber/console
  2. Use the required credentials to open the Home page of the Oracle WebLogic Server Administration Console.

    The Home page of the Oracle WebLogic Server Administration Console is displayed, as shown in Figure 8-13.

    Figure 8-13 The Oracle WebLogic Server Administration Console Home Page

    Description of Figure 8-13 follows
    Description of "Figure 8-13 The Oracle WebLogic Server Administration Console Home Page"
  3. Navigate to Services, Messaging, JMS Modules in the Domain Structure pane.

    The Oracle WebLogic Server Administration Console - JMS Modules page is displayed.

  4. Click one of the existing modules. In this example, click SOAJMSModule.

    The Oracle WebLogic Server Administration Console - Settings for SOAJMSModule page is displayed.

  5. Under the Summary of Resources section, click New.

    The Oracle WebLogic Server Administration Console - Create a New JMS System Module Resource page is displayed.

  6. Select Queue, and then click Next.
  7. Enter the following queue details:
    • Name

    • JNDI Name

    • Template

  8. Click Next.
  9. Select the subdeployment you want to use from the Subdeployments list.
  10. Click Finish.

    You have created the queue, ReceiveQueue.

  11. Repeat steps 1 through 10, and create a queue named SendQueue.
8.4.5.1.2 Creating the Q2Qorders.xsd file

Create the Q2Qorders.xsd file with the following contents:

<?xml version="1.0" ?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
            xmlns:nxsd="http://xmlns.oracle.com/pcbpel/nxsd"
            targetNamespace="http://xmlns.oracle.com/
                 pcbpel/nxsd/extensions/FileInbound"
            xmlns:tns="http://xmlns.oracle.com/
            pcbpel/nxsd/extensions/FileInbound"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified" 
              nxsd:encoding="US-ASCII" nxsd:stream="chars" 
                        nxsd:version="NXSD">
  <xsd:element name="Items">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element name="item" minOccurs="1" 
                              maxOccurs="unbounded">
          <xsd:complexType>
            <xsd:sequence>
              <xsd:element name="Name" type="xsd:string" 
                nxsd:style="terminated" 
                 nxsd:terminatedBy="," nxsd:quotedBy="&quot;">
              </xsd:element>
              <xsd:element name="Type" type="xsd:string"
                 nxsd:style="terminated" 
                  nxsd:terminatedBy="," nxsd:quotedBy="&quot;">
              </xsd:element>
              <xsd:element name="Quantity" 
                  type="xsd:string" nxsd:style="terminated"
                           nxsd:terminatedBy=","
                             nxsd:quotedBy="&quot;">
              </xsd:element>
              <xsd:element name="Rate" 
                type="xsd:string"
                  nxsd:style="terminated" 
                  nxsd:terminatedBy="${eol}" nxsd:quotedBy="&quot;">
              </xsd:element>
            </xsd:sequence>
          </xsd:complexType>
        </xsd:element>
      </xsd:sequence>
    </xsd:complexType>
  </xsd:element>
</xsd:schema>
<!--NXSDWIZ:C:\errors\inputFiles\orders.txt:-->
8.4.5.2 Creating an Application Server Connection

You must establish connectivity between the design-time environment and the server you want to deploy to. Perform the steps mentioned in Creating an Application Server Connection for Oracle JCA Adapters to create an application server connection.

8.4.5.3 Creating an Application and a SOA Project

You must create an JDeveloper application to contain the SOA composite. To create an application and a SOA project, perform the following steps:

  1. Open JDeveloper.
  2. In the Application Navigator, click New Application. The New Gallery dialog is displayed.
  3. Select SOA Application and click OK. Enter a name for the application in the Application Name field. For example, queue2queue.
  4. Click Next.

    The Name your project page is displayed.

  5. In the Project Name field, enter a descriptive name. For example, queue2queue.
  6. Click Next. The Configure SOA settings page is displayed.
  7. Select Composite With BPEL Process from the Composite Template list, and then click Finish.

    You have created a new application, and a SOA project.

    The Create BPEL Process page is displayed.

  8. Enter a name for the BPEL process in the Name field. For example, queue2queue.
  9. Select Define Interface Later in the Template list, and then click OK.

    You have created a BPEL process.

    The queue2queue application, queue2queue project, and the SOA composite appear in the design area.

  10. Copy the Q2Qorders.xsd file to the XSD folder in your project.
8.4.5.4 Creating an Inbound Adapter Service

Perform the following steps to create an adapter service that dequeues the message to a queue:

  1. Drag and drop JMS Adapter from the Service Adapters list to the Exposed Services swim lane in the composite.xml page. The Adapter Configuration Wizard Welcome page is displayed.
  2. Enter Inbound in the Service Name field, and click OK. The JMS Provider page is displayed.
  3. Select Oracle Weblogic JMS in the Oracle Enterprise Messaging Service (OEMS) box, and click Next. The Service Connection page is displayed.

    Figure 8-14 The Adapter Configuration Wizard JMS Provider Page

    Description of Figure 8-14 follows
    Description of "Figure 8-14 The Adapter Configuration Wizard JMS Provider Page"
  4. Select the connection created in Creating an Application Server Connection, as shown in Figure 8-15.

    Figure 8-15 The Adapter Configuration Wizard Service Connection Page

    Description of Figure 8-15 follows
    Description of "Figure 8-15 The Adapter Configuration Wizard Service Connection Page"
  5. Click Next. The Adapter Interface page is displayed.
  6. Select Define from operation and schema (specified later), and click Next. The Operation page is displayed.
  7. Select Consume Message, as shown in Figure 8-16, and click Next. The Consume Operation Parameters page is displayed.

    Figure 8-16 The Adapter Configuration Wizard Operation Page

    Description of Figure 8-16 follows
    Description of "Figure 8-16 The Adapter Configuration Wizard Operation Page"
  8. Click Browse and select ReceiveQueue in the Destination field.

    The Consume Operation Parameters page is displayed.

  9. Enter the parameters for the consume operation, and then click Next.

    The Messages page is displayed.

    Note:

    The value specified in the JNDI name should exist in the Oracle JMS Adapter weblogic-ra.xml file to ensure that the Adapter runs in managed mode.

  10. Click Browse at the end of the URL field.

    The Type Chooser dialog is displayed.

  11. Select Project Schema Files, Q2Qorders.xsd, and Items.

    Figure 8-17 The Type Chooser Dialog

    Description of Figure 8-17 follows
    Description of "Figure 8-17 The Type Chooser Dialog"
  12. Click Next. The Q2Qorders.xsd schema file is displayed in the URL in the Messages page.

    Figure 8-18 The Adapter Configuration Wizard - Message Page

    Description of Figure 8-18 follows
    Description of "Figure 8-18 The Adapter Configuration Wizard - Message Page"
  13. Click Next. The JCA Endpoint Properties screen is displayed.
    The JCA Endpoint Properties screen appears for inbound if you have selected the Reference Configuration option. For more information, see JCA Endpoint Properties in the Adapter Configuration Wizard.
  14. Click Next. The Finish page is displayed.
  15. Click Finish. You have configured a JMS inbound adapter service.
8.4.5.5 Creating an Outbound Adapter Service

Perform the following steps to create an adapter service to enqueue the request messages and dequeue the corresponding response messages (report) from a queue:

  1. Drag and drop JMS Adapter from the Components window into the Exposed Services swim lane. The Adapter Configuration Wizard Welcome page is displayed.
  2. Enter Outbound in the Service Name field, and click OK. The JMS Provider page is displayed.
  3. Select Oracle Weblogic JMS in the Oracle Enterprise Messaging Service (OEMS) box, and click Next. The Service Connection page is displayed.
  4. Select the connection created in Creating an Application Server Connection, and click Next. The Adapter Interface page is displayed.
  5. Select Define from operation and schema (specified later), and click Next. The Operation page is displayed.
  6. Select Produce Message, and click Next. The Produce Operation Parameters page is displayed.
  7. Click Browse and select SendQueue in the Destination field. The Produce Operation Parameters page is displayed.
  8. Click Next. The Messages page is displayed.
  9. Click Browse at the end of the URL field. The Type Chooser dialog is displayed.
  10. Select Project Schema Files, Q2Qorders.xsd, and Items.
  11. Click Next. The Q2Qorders.xsd schema file is displayed in the URL in the Message dialog.
  12. Click Next. The Finish page is displayed.
  13. Click Finish. You have configured the JMS adapter service, and the composite.xml page is displayed.
8.4.5.6 Wiring Services and Activities

You must wire the three components that you have created, Inbound adapter service, BPEL process, and Outbound adapter reference. Perform the following steps to wire components:

  1. Drag the small triangle in the inbound Oracle JMS Adapter component in the Exposed Services area to the drop zone that appears as a green triangle in the BPEL process in the Components area.
  2. Drag the small triangle in the BPEL process in the Components area to the drop zone that appears as a green triangle in the outbound Oracle JMS Adapter in the External References area.

    The JDeveloper Composite.xml is displayed, as shown in Figure 8-19.

    Figure 8-19 The JDeveloper - Composite.xml

    Description of Figure 8-19 follows
    Description of "Figure 8-19 The JDeveloper - Composite.xml"
  3. Click File, Save All.
  4. Double-click queue2queue.

    The queue2queue.bpel page is displayed.

  5. Drag and drop the Receive, Assign, and Invoke activities in the order mentioned from the Components window to the Components area, as shown in Figure 8-20.

    Figure 8-20 The queue2queue.bpel Page

    Description of Figure 8-20 follows
    Description of "Figure 8-20 The queue2queue.bpel Page"
  6. Double-click Receive.

    The Receive dialog is displayed.

  7. Click the Browse Partner Links icon at the end of the Partner Link field.

    The Partner Link Chooser dialog is displayed.

  8. Select Inbound, and then click OK.

    The Receive dialog is displayed with the Partner Link field populated with the value Inbound.

  9. Click the Auto-Create Variable icon that is displayed at the end of the Variable field.

    The Create Variable dialog is displayed.

  10. Accept the defaults, and click OK.
  11. Select the Create Instance box, as shown in Figure 8-21, and click OK.
  12. Double-click the Invoke activity.

    The Invoke dialog is displayed.

  13. Click the Browse Partner Links icon at the end of the Partner Link field.

    The Partner Link Chooser dialog is displayed.

  14. Select Outbound, and then click OK.

    The Invoke dialog is displayed with the Partner Link field populated with the value Outbound.

  15. Click the Automatically Create Input Variable icon that is displayed at the end of the Input Variable field.

    The Create Variable dialog is displayed.

  16. Accept the defaults, and click OK.

    The Invoke dialog is displayed, as shown in Figure 8-22.

  17. Click OK.
  18. Double-click the Assign activity.

    The Assign dialog is displayed.

  19. Click the plus icon, and select Copy Operation. The Create Copy Operation dialog is displayed.
  20. Select the variables, as shown in Figure 8-23, and click OK.

    Figure 8-23 The Create Copy Operation Dialog

    Description of Figure 8-23 follows
    Description of "Figure 8-23 The Create Copy Operation Dialog"
  21. Click OK in the Assign dialog.
  22. Click File, Save All.
8.4.5.7 Deploying with JDeveloper

You must deploy the application profile for the SOA project and the application you created in the preceding steps. To deploy the application profile using JDeveloper, perform the following steps:

  1. Create an application server connection. For more information, see Creating an Application Server Connection for Oracle JCA Adapters.
  2. Deploy the application. For more information, see Deploying Oracle JCA Adapter Applications from JDeveloper.
8.4.5.8 Monitoring Using the Oracle Fusion Middleware Control Console

You can monitor the deployed composite using the Fusion Middleware Control Console. Perform the following steps:

  1. Navigate to http://servername:portnumber/em. The composite you deployed appears in the application navigator.
  2. In the Last 5 Instances pane, there is an entry of a new instance. This is the instance that was triggered when you enqueued a message using queue2queue.java.
  3. Click one of the instances. The Flow Trace page is displayed.
  4. Click the TextMessage component instance. The Audit page is displayed.
  5. Click the Flow-Debug tab to debug the instance.

8.4.6 Accessing Queues and Topics from WLS JMS Server in a Remote Oracle WebLogic Server Domain

You can use the Oracle JMS Adapter to access remote WLS JMS destinations. Remote destinations refer to queues or topics that are defined in a WLS JMS server, which is part of a remote Oracle WebLogic Server domain.

To do so, ensure that you use the connector factory configured to interact to the remote WLS JMS server. You can achieve this by setting the <FactoryProperties> property of the connector factory defined in weblogic-ra.xml to remote server configuration, as shown in the following example:

<property>
  <name>FactoryProperties</name>
     <value>java.naming.factory.initial
                =weblogic.jndi.WLInitialContextFactory; 
                       java.naming.provider.url= t3://<HOST>:<PORT>;
                     java.naming.security.principal= 
                         <USERNAME>;java.naming.security.credentials
                                     =<PASSWORD>
     </value>
</property>

To enable the Oracle JMS Adapter to read from a remote queue that is present in a remote WLS JMS server, you must configure the following:

  1. You must have a unique domain name and JMS server name in both the servers.

  2. You must enable global trust between the two servers.

    Refer to the following link for information about how to enable global trust between servers:

    http://download.oracle.com/docs/cd/E13222_01/wls/docs100/ConsoleHelp/taskhelp/security/EnableGlobalTrustBetweenDomains.html

    This configuration is appropriate when you connect to queues or topics present in WLS9.2 server.

    Note:

    When using the JMS adapter to access WebLogic Server secure queues (local or remote domains), ensure that java.naming.security.principal and java.naming.security.credentials in the FactoryProperties property are setup correctly with a user who has access to the WLS secure queues.

8.4.6.1 JMS Adapter Limitations When a Remote Server is Used

The JMS Adapter enables you to interact with WebLogic Server JMS destination locations in a domain that are remote to the WebLogicServer domain where SOA is installed.

Two options are supported that enable you to access remote destinations using the JMS adapter:

  • Direct access using specification of the FactoryProperties property in the weblogic-ra.xml file, with access parameters indicating the remote domain.

  • Configuring the foreign server to access the remote domain.

For inbound use cases, both options are supported. For outbound use cases only, direct access is supported, but configuring the foreign server is not supported.

8.4.7 Synchronous/Asynchronous Request Reply Interaction Pattern

The Oracle JMS Adapter supports both synchronous and asynchronous request reply interaction patterns.

8.4.7.1 Synchronous Request Reply Pattern

You can use the Adapter Configuration Wizard to model a process that enables the Oracle JMS Adapter to be used in a synchronous request reply interaction pattern. In this case, the Oracle JMS Adapter sends a request to the request queue and waits for a response from the reply queue before further execution continues.

Underneath, the Oracle JMS Adapter uses a new interaction pattern, JmsRequestReplyInteractionSpec. This interaction spec allows for a request and reply destination name to be configured.

A variation enables usage of a temporary destination as part of the reply queue. Basically, this pattern enables an Oracle JMS Adapter to send a message to a JMS destination. In turn, the Adapter sets the JMSReplyTo header to the reply destination.

This value is then used by a third-party client to send the message to the reply destination which is then dequeued by the Oracle JMS Adapter.

When using the Oracle JMS Adapter in a synchronous pattern, you can use an XA ConnectionFactory for JMS or BPEL incoming events, and set the connector factory isTransacted property to true in weblogic-ra.xml. However, if you are using a web service, ensure that you use a non-XA ConnectionFactory, and set the connector factory isTransacted property to true in weblogic-ra.xml.

When you use the Oracle JMS Adapter in a synchronous pattern with Oracle WebLogic Server JMS, the connection factory must be weblogic.jms.ConnectionFactory or any other non-XA connection factory. Also, if Oracle WebLogic Server JMS is running in the local JVM (the same JVM as the adapter), then you must ensure that the connector factory isTransacted property is set to false in weblogic-ra.xml.

8.4.7.2 Asynchronous Request Reply Pattern

You can use the Adapter Configuration Wizard to model a process that allows Oracle JMS Adapter to be used in an asynchronous request reply interaction pattern.

Basically this pattern allows an Oracle JMS Adapter to send a message to a JMS destination. When a message is received on the reply queue, the Oracle JMS Adapter can route messages to the correct composite or the component instance. The correlation is done based on the JMSMessageID of the request message, which becomes the JMSCorrelationID of the reply message, and the conversation ID of the underlying component.

8.4.7.3 Example

In order for the Oracle JMS Adapter request reply to work correctly, the reply component must copy the received JMS message's JMSMessageID to the reply message's JMSCorrelationID. Also, in order for the Oracle Mediator Callback to work with the Oracle JMS Adapter request reply, the reply component must copy the received normalized message's tracking conversationId, InstanceId, CompositeSCAEntityId, and compositeInstanceId to the corresponding properties of the reply normalized message. The following BPEL example shows how to retrieve and copy the properties.

Suppose in BPEL there is a receive activity that receives the request JMS message and there is a reply activity that produces the reply JMS message:


<variables>
  <variable name="receiveInput_Consume_Message_InputVariable" messageType="ns1:Consume_Message_msg"/>
  <variable name="Invoke1_Produce_Message_InputVariable" messageType="ns3:Produce_Message_msg"/>
  <variable name="MessageID" type="xsd:string"/>
  <variable name="JMSReplyTo" type="xsd:string"/>
  <variable name="conversationId" type="xsd:string"/>
  <variable name="InstanceId" type="xsd:string"/>
  <variable name="CompositeSCAEntityId" type="xsd:string"/>
  <variable name="compositeInstanceId" type="xsd:string"/>
</variables>
<receive name="receiveInput" partnerLink="jmsService" portType="ns1:Consume_Message_ptt"
         operation="Consume_Message" variable="receiveInput_Consume_Message_InputVariable" createInstance="yes">
  <bpelx:fromProperties>
    <bpelx:fromProperty name="jca.jms.JMSMessageID" variable="MessageID"/>
    <bpelx:fromProperty name="jca.jms.JMSProperty.JCA_JMSReplyTo" variable="JMSReplyTo"/>
    <bpelx:fromProperty name="tracking.conversationId" variable="conversationId"/>
    <bpelx:fromProperty name="tracking.InstanceId" variable="InstanceId"/>
    <bpelx:fromProperty name="tracking.CompositeSCAEntityId" variable="CompositeSCAEntityId"/>
    <bpelx:fromProperty name="tracking.compositeInstanceId" variable="compositeInstanceId"/>
  </bpelx:fromProperties>
</receive>
<!-- process the received message and create a reply message-->

<if name="If1">
  <documentation>
    <![CDATA[need to check the JMSReplyTo variable to make sure it is not null and contains something like jms_server_name@queue_JNDI_name
            For asynchronous request/reply the received message's jca.jms.JMSProperty.JCA_JMSReplyTo is null]]>
  </documentation>
  <condition expressionLanguage="urn:oasis:names:tc:wsbpel:2.0:sublang:xpath1.0">
     contains($JMSReplyTo, '@')
  </condition>
  <invoke name="Invoke1" inputVariable="Invoke1_Produce_Message_InputVariable"
        partnerLink="jmsReference" portType="ns3:Produce_Message_ptt" operation="Produce_Message"
        bpelx:invokeAsDetail="no">
    <bpelx:toProperties>
      <bpelx:toProperty name="jca.jms.JMSCorrelationID" variable="MessageID"/>
      <bpelx:toProperty name="jca.jms.JMSDestinationName" variable="JMSReplyTo"/>
      <bpelx:toProperty name="tracking.InstanceId" variable="InstanceId"/>
      <bpelx:toProperty name="tracking.CompositeSCAEntityId" variable="CompositeSCAEntityId"/>
      <bpelx:toProperty name="tracking.compositeInstanceId" variable="compositeInstanceId"/>
      <bpelx:toProperty name="tracking.conversationId" variable="conversationId"/>
    </bpelx:toProperties>
  </invoke>
  <else>
    <invoke name="Invoke1" inputVariable="Invoke1_Produce_Message_InputVariable"
          partnerLink="jmsReference" portType="ns3:Produce_Message_ptt" operation="Produce_Message"
          bpelx:invokeAsDetail="no">
      <bpelx:toProperties>
        <bpelx:toProperty name="jca.jms.JMSCorrelationID" variable="MessageID"/>
        <bpelx:toProperty name="tracking.InstanceId" variable="InstanceId"/>
        <bpelx:toProperty name="tracking.CompositeSCAEntityId" variable="CompositeSCAEntityId"/>
        <bpelx:toProperty name="tracking.compositeInstanceId" variable="compositeInstanceId"/>
        <bpelx:toProperty name="tracking.conversationId" variable="conversationId"/>
      </bpelx:toProperties>
    </invoke>  
  </else>
</if>

8.4.8 AQ JMS Text Message

This use case demonstrates how the Oracle JMS Adapter dequeues from and enqueues to the AQ JMS Queue.

This section includes the following topics:

8.4.8.1 Prerequisites

You must perform the following prerequisites to complete this use case:

8.4.8.1.1 Configuring AQ JMS in Oracle WebLogic Server Administration Console

To configure AQ JMS in Oracle WebLogic Server Administration Console, you must perform the following steps:

Adding an Oracle WebLogic JMS Module

Note that adding an Oracle WebLogic JMS module is optional. You can also create an AQJMS foreign server in a preexisting JMS module.

  1. Navigate to the Oracle WebLogic Server JMS: http://servername:portnumber/console.

  2. Use the required credentials to open the Home page of the Oracle WebLogic Server Administration Console.

    The Home page of the Oracle WebLogic Server Administration Console is displayed.

  3. Navigate to Services, Messaging, JMS Modules in the Domain Structure pane.

    The Oracle WebLogic Server Administration Console - JMS Modules page is displayed.

  4. Click New to create a new WebLogic JMS module.

    The Oracle WebLogic Server Administration Console - Create JMS System Module page is displayed.

  5. Enter a name for the JMS module, and then click Next.

    The Oracle WebLogic Server Administration Console-Create JMS System Module page is displayed.

  6. Select a target server where your SOA component is running, and then click Next.

    The Oracle WebLogic Server Administration Console - Create JMS System Module page is displayed.

  7. Click Finish.

    You have created a JMS module.

Adding an AQJMS Foreign Server to the JMS Module

The next step is to add an AQ JMS foreign server to the JMS module by performing the following:

  1. Click the JMS module that you created.

    The Oracle WebLogic Server Administration Console - Settings for AQJMS Module page is displayed.

  2. Click New in the Summary of Resources table to create a new JMS system module resource.

    The Oracle WebLogic Server Administration Console - Create a New JMS System Module Resource page is displayed.

  3. Under Choose the type of resource you want to create, select Foreign Server, and click Next.

    The Oracle WebLogic Server Administration Console - Create a New JMS System Module Resource page is displayed.

  4. In the Name field, enter a name for the foreign server, and then click Finish.

    The Oracle WebLogic Server Administration Console - Settings for <JMS Module Name> page is displayed.

Configuring the AQJMS Foreign Server

The next step is to configure the AQJMS foreign server that you created:

  1. Click the AQ JMS Foreign Server listed under the Summary of Resources table.

    The Oracle WebLogic Server Administration Console - Settings for TestAQJMS_ForeignServer page is displayed.

  2. Enter the following values:

    • JNDI Initial Context Factory: oracle.jms.AQjmsInitialContextFactory

      If the AQJMS Foreign Server is used by the WebLogic server side components, then you must configure a data source with this AQ JMS Foreign Server, by specifying the following values:

      In the JNDI Properties field, enter datasource=<datasource jndi location>. Replace the place holder with the JNDI location of your data source.

      However, if the AQJMS Foreign Server is used by WebLogic application client, then you must configure the JDBC URL with the AQ JMS foreign server you created.

    • JNDI Connection URL: Specify the URL that WebLogic Server uses to contact the JNDI provider.

      This value is required only if the AQJMS foreign server is used by the WebLogic application client.

    • JNDI Properties Credential: Specify any Credentials that must be set for the JNDI provider.

      This value is required only if the AQJMS foreign server is used by the Weblogic application client.

Note:

If you want to use an Oracle RAC database as adapter endpoint, the datasource pointed by the JNDI property, mentioned in the preceding step, must point to a multi data source.

Individual data sources and multi data sources used for such endpoints must use the recommended setting listed in Recommended Setting for Data Sources Used by Oracle JCA Adapters.

Adding Connection Factories to the AQ JMS Foreign Server

To add connection factories to the AQJMS foreign server:

  1. In the Connection Factories tab in the Settings for <Foreign Server Name> page, select the AQJMS foreign server that you created.

  2. Click New.

    The Oracle WebLogic Server Administration Console - Create a New Foreign JMS Connection Factory page is displayed.

  3. In the Name field, enter a name for this connection factory. This is a logical name that would be referenced by Oracle WebLogic Server.

  4. In the Local JNDI Name field, enter the local JNDI name that you would use in your application to look up this connection factory.

  5. In the Remote JNDI Name field, enter one of the following values depending on your requirement. If you use this connection factory in a global transaction, then use an XA-based connection factory, else use non-XA based connection factory.

    • QueueConnectionFactory

    • TopicConnectionFactory

    • ConnectionFactory

    • XAQueueConnectionFactory

    • XATopicConnectionFactory

    • XAConnectionFactory

  6. Click OK.

Adding Destinations to the AQJMS Foreign Server

To add destinations to the AQJMS foreign server:

  1. Click the Destinations tab in the Settings for <Foreign Server Name> page.
  2. Click New and specify a name for this destination. This is a logical name that is referenced by the Oracle WebLogic Server and has nothing to do with the destination name.
  3. In the Local JNDI Name field, enter the local JNDI name you would use in your application to look up this destination.
  4. In the Remote JNDI Name field, enter Queues/<queue name>. If the destination is a queue, or enter Topics/<topic name> if the destination is a topic.
  5. Click OK.
  6. Restart the Oracle WebLogic Server Administration Console.

You have configured AQJMS in an Oracle WebLogic Server.

8.4.8.1.2 Creating Queues in Oracle Database

To create queues, you must first create the following files and execute them in the following order:

  • setup_user.sql

  • create_start_queues.sql

Contents of setup_user.sql

GRANT CONNECT, RESOURCE to scott;
GRANT EXECUTE ON SYS.DBMS_AQ to scott;
GRANT EXECUTE ON SYS.DBMS_AQADM to scott;
GRANT EXECUTE ON SYS.DBMS_AQIN to scott;
commit;

Contents of create_start_queues.sql

SET ECHO ON
SET FEEDBACK 1
SET NUMWIDTH 10
SET LINESIZE 80
SET TRIMSPOOL ON
SET TAB OFF
SET PAGESIZE 100
exec dbms_aqadm.create_queue_table ( queue_table=> 'DemoInQueue', queue_payload_type=> 'SYS.AQ$_JMS_TEXT_MESSAGE', multiple_consumers=> FALSE, compatible=> '8.1'); 
COMMIT;
/
exec dbms_aqadm.create_queue(queue_name=> 'DemoInQueue', queue_table=> 'DemoInQueue'); 
COMMIT;
/
exec dbms_aqadm.start_queue('DemoInQueue'); 
COMMIT;
/
exec dbms_aqadm.create_queue_table ( queue_table=> 'DemoOutQueue', queue_payload_type=> 'SYS.AQ$_JMS_TEXT_MESSAGE', multiple_consumers=> FALSE, compatible=> '8.1'); 
COMMIT;
/
exec dbms_aqadm.create_queue(queue_name=> 'DemoOutQueue', queue_table=> 'DemoOutQueue'); 
COMMIT;
/
exec dbms_aqadm.start_queue('DemoOutQueue'); 
COMMIT;
/
8.4.8.2 Creating an Application Server Connection

You must establish connectivity between the design-time environment and the server you want to deploy to. Perform the steps in Creating an Application Server Connection for Oracle JCA Adapters to create an application server connection.

8.4.8.3 Creating an Application and a SOA Project

You must create an JDeveloper application to contain the SOA composite. To create an application and a SOA project, perform the following steps:

  1. Open JDeveloper.
  2. In the Application Navigator, click New Application. The Create Generic Application - Name your Application dialog is displayed.
  3. Enter a name for the application in the Application Name field. For example, AQQueue2Queue.
  4. In the Application Template list, choose Generic Application.
  5. Click Next.

    The Name your project page is displayed.

  6. In the Project Name field, enter a descriptive name. For example, AQQueue2Queue.
  7. In the Available list in the Project Technologies tab, double-click SOA to move it to the Selected list.
  8. Click Next. The Create Generic Application - Configure SOA Settings page is displayed.
  9. Select Composite With BPEL from the Composite Template list, and then click Finish.

    You have created a new application and a SOA project.

    The Create BPEL Process page is displayed.

  10. Enter a name for the BPEL process in the Name field.
  11. Select Define Interface Later in the Template list, and then click OK.

    You have created a BPEL process.

    The AQQueue2Queue application, the AQQueue2Queue project, and the SOA composite appear in the design area.

  12. Create a file named expense.xsd in the XSD folder in your project:

    Contents of expense.xsd:

    <?xml version= '1.0' encoding= 'UTF-8' ?>
    <schema elementFormDefault="qualified" targetNamespace="http://xmlns.oracle.com/pcbpel/samples/expense"
         xmlns="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://xmlns.oracle.com/pcbpel/samples/expense">
        <element name="ExpenseRecord">
            <complexType>
                <sequence>
                    <element name="EmpId" type="integer" minOccurs="0"/>
                    <element name="Item" type="string" minOccurs="0"/>
                    <element name="Count" type="integer" minOccurs="0"/>
                    <element name="Cost" type="double" minOccurs="0"/>
                </sequence>
            </complexType>
        </element>
    </schema>
8.4.8.4 Creating an Inbound Adapter Service

Perform the following steps to create an adapter service to dequeue the message to a queue:

  1. Drag and drop JMS Adapter from the Service Adapters list into the Exposed Services swim lane. The Adapter Configuration Wizard Welcome page is displayed.
  2. Enter Inbound in the Service Name field, and click OK. The JMS Provider page is displayed.
  3. Select Oracle Advanced Queueing in the Oracle Enterprise Messaging Service (OEMS) box, and click Next. The Service Connection page is displayed.
  4. Select the connection created in Creating an Application Server Connection.
  5. Click Next. The Adapter Interface page is displayed.
  6. Select Define from operation and schema (specified later), and click Next. The Operation page is displayed.
  7. Select Consume Message, and click Next. The Consume Operation Parameters page is displayed.
  8. Click Browse and select testInQueue in the Destination field.
  9. Click Next. The Messages page is displayed.
  10. Click Browse at the end of the URL field. The Type Chooser dialog is displayed.
  11. Select Project Schema Files and expense.xsd.
  12. Click Next. The expenses.xsd schema file is displayed in the URL field in the Messages page.
  13. Click Next. The JCA Endpoint Properties screen is displayed.
    The JCA Endpoint Properties screen appears for inbound if you have selected the Reference Configuration option. For more information, see JCA Endpoint Properties in the Adapter Configuration Wizard.
  14. Click Next. The Finish page is displayed.
  15. Click Finish. You have configured a JMS inbound adapter service.
8.4.8.5 Creating an Outbound Adapter Service

Perform the following steps to create an adapter service that enqueues the request messages and dequeue the corresponding response messages (report) from a queue:

  1. Drag and drop JMS Adapter from the Components window into the Exposed Services swim lane. The Adapter Configuration Wizard Welcome page is displayed.
  2. Enter Outbound in the Service Name field, and click OK. The JMS Provider page is displayed.
  3. Select Oracle Advanced Queueing in the Oracle Enterprise Messaging Service (OEMS) box, and click Next. The Service Connection page is displayed.
  4. Select the connection created in Creating an Application Server Connection, and click Next. The Adapter Interface page is displayed.
  5. Select Define from operation and schema (specified later), and click Next. The Operation page is displayed.
  6. Select Produce Message, and click Next. The Produce Operation Parameters page is displayed.
  7. Click Browse and select testOutQueue in the Destination field. The Produce Operation Parameters page is displayed.
  8. Click Next. The Messages page is displayed.
  9. Click Browse at the end of the URL field. The Type Chooser dialog is displayed.
  10. Select Project Schema Files, expense.xsd.
  11. Click Next. The expense.xsd schema file is displayed in the URL field in the Message dialog.
  12. Click Next. The Finish page is displayed.
  13. Click Finish. You have configured the JMS adapter service, and the composite.xml page is displayed.
8.4.8.6 Wiring Services and Activities

You must wire the three components that you have created: Inbound adapter service, BPEL process, and Outbound adapter reference.

Perform the following steps to wire the components:

  1. Drag the small triangle in the inbound Oracle JMS Adapter component in the Exposed Services area to the drop zone that appears as a green triangle in the BPEL process in the Components area.
  2. Drag the small triangle in the BPEL process in the Components area to the drop zone that appears as a green triangle in the outbound Oracle JMS Adapter in the External References area.

    The JDeveloper Composite.xml is displayed, as shown in Figure 8-24.

    Figure 8-24 JDeveloper - Composite.xml

    Description of Figure 8-24 follows
    Description of "Figure 8-24 JDeveloper - Composite.xml"
  3. Click File, Save All.
  4. Double-click the BPEL process. The BPELProcess1.bpel page is displayed.
  5. Drag and drop the Receive, Assign, and Invoke activities, in the order mentioned, from the Components window to the Components area.
  6. Double-click the Receive activity.

    The Receive dialog is displayed.

  7. Click the Browse Partner Links icon at the end of the Partner Link field.

    The Partner Link Chooser dialog is displayed.

  8. Select Inbound, and then click OK.

    The Receive dialog is displayed with the Partner Link field populated with the value Outbound.

  9. Click the Auto-Create Variable icon that is displayed at the end of the Variable field. The Create Variable dialog is displayed.
  10. Accept the defaults, and click OK.
  11. Check the Create Instance box.
  12. Double-click the Invoke activity to Outbound.

    The Invoke dialog is displayed.

  13. Click the Automatically Create Input Variable icon that is displayed at the end of the Input Variable field.
  14. Click the Browse Partner Links icon at the end of the Partner Link field.

    The Partner Link Chooser dialog is displayed.

  15. Select Outbound, and then click OK.

    The Invoke dialog is displayed with the Partner Link field populated with the value Outbound.

  16. Accept the defaults, and click OK.
  17. Click OK.
  18. Double-click the Assign activity.

    The Assign dialog is displayed.

  19. Click the plus icon, and select Copy Operation.

    The Create Copy Operation dialog is displayed.

  20. Select the variables, and click OK.
  21. Click OK in the Assign dialog.
  22. Click File, Save All.

Note:

When using Oracle JMS Adapter to dequeue from AQ JMS Topics with durable subscriptions, if you notice that the dequeue operation exhibits slow performance, then you can speed up the entire performance by using multiple inbound threads for each adapter service.

Oracle JMS Adapter allows multiple inbound threads if you specify an endpoint property adapter.jms.receive.threads.

However, this workaround is not applicable when using non-durable subscriptions because doing using the workaround in that scenario results in duplicate messages.

8.4.8.7 Deploying with JDeveloper

You must deploy the application profile for the SOA project and the application you created in the preceding steps. To deploy the application profile using JDeveloper, perform the following steps:

  1. Create an application server connection. For more information, see Creating an Application Server Connection for Oracle JCA Adapters.
  2. Deploy the application. For more information, see Deploying Oracle JCA Adapter Applications from JDeveloper.
8.4.8.8 Monitoring Using the Oracle Fusion Middleware Control Console

You can monitor the deployed composite using the Fusion Middleware Control Console. Perform the following steps:

  1. Navigate to http://servername:portnumber/em. The composite you deployed appears in the application navigator.
  2. In the Last 5 Instances pane, there is an entry of a new instance. This is the instance that was triggered when you enqueued a message by using AQQueue2Queue.java.
  3. Click one of the instances. The Flow Trace page is displayed.
  4. Click the TextMessage component instance. The Audit page is displayed.
  5. Click the Flow-Debug tab to debug the instance.

8.4.9 Accessing Queues and Topics Created in 11g from the OC4J 10.1.3.4 Server

This section describes the procedure for accessing queues and topics you created in Oracle Application Server 11g or 12.1.3 from OC4J 10.1.3.4.

To do this, you must configure Oracle BPEL PM JMS adapter with Oracle WebLogic Server.

The following are the steps to configure Oracle BPEL PM JMS adapter with Oracle WebLogic Server:

  1. Create the wlfullclient.jar file using the following steps:

    1. Change to the server/lib directory, as shown in the following example:

      cd WL_HOME/server/lib
      
    2. Use the following command to create the wlfullclient.jar file in the server/lib directory:

      java -jar ../../../modules/com.bea.core.jarbuilder_X.X.X.X.jar
      

      where X.X.X.X is the version number of the jarbuilder module in the WL_HOME/server/lib directory. For example:

      java -jar ../../../modules/com.bea.core.jarbuilder_1.0.1.0.jar
      
  2. Copy the wlfullclient.jar file to the 10.1.3.4. server at the following location:

    <ORACLEAS_HOME>/j2ee/<OC4J_INSTANCE>/connectors/
                   JmsAdapter/JmsAdapter
    
  3. Configure the connector factory setting in the oc4j-ra.xml file, as shown in the following example:

    <connector-factory location="eis/wlsjms/Queue" 
    connector-name="Jms Adapter">
       <config-property name="connectionFactoryLocation"                
    value="weblogic.jms.ConnectionFactory"/>
       <config-property name="factoryProperties"         
    value="java.naming.factory.initial=weblogic.jndi.
    WLInitialContextFactory;java.naming.provider.url=t3:
                               //<WLS-SERVER-NAME>: <WLS-SERVER-PORT>;
    java.naming.security.principal=<USER>;
                   java.naming.security.credentials=
                            <PASSWORD>"/> 
           <config-property name="acknowledgeMode" 
                                    value="AUTO_ACKNOWLEDGE"/>
           <config-property name="isTopic" value="false"/>
           <config-property name="isTransacted" value="false"/>
           <config-property name="username" value=""/>
           <config-property name="password" value=""/>
       <connection-pooling use="none">
       </connection-pooling>
         <security-config use="none">
         </security-config>
    </connector-factory>
    

    Note:

    The isTransacted configuration property value must typically be set to FALSE. Currently, XA integration with WebLogic JMS is not supported unless the adapter is deployed on the Oracle WebLogic Server. Also note that <WLS-SERVER-NAME> must be replaced by the actual Weblogic Server name hosting the queues, and <WLS-SERVER-PORT> must be replaced by the actual port value for Weblogic Server hosting the queues.

  4. Modify the server.xml file of the 10.1.3.4 server to include the environment-naming-url-factory-enabled="true" property, as shown in the following example:

    <application-server
    ...
    ...
    environment-naming-url-factory-enabled="true"
    ...
    > 
    
  5. Restart the 10.1.3.4 server to ensure the changes occur.

8.4.10 Configuring the 11G Server or Later Server to Access Queues Present in 10.1.3.X OC4J

You can configure your 11G or later server to access queues present in 10.1.3.x OC4J with the following steps.

8.4.10.1 Copy Jar Files into the domains Folder of the Web Logic Server

Copy the following jar files under the domains/<DOMAIN_NAME>/lib folder of the WebLogic Server:

  • $J2EE_HOME/lib/jms.jar

  • $J2EE_HOME/lib/jta.jar

  • $J2EE_HOME/oc4jclient.jar

  • $AS_HOME/opmn/lib/optic.jar

8.4.10.2 Add Connector factory in the weblogic-ra.xml File

The next step is to add the Connector Factory in the weblogic-ra.xml file:

<connection-instance>
   <jndi-name>eis/oc4jjms/Queue</jndi-name>
    <connection-properties>
       <properties>
        <property>
          <name>ConnectionFactoryLocation</name>
          <value>jms/XAQueueConnectionFactory</value>
         </property>
         <property>
          <name>FactoryProperties</name>
            <value>java.naming.factory.initial=com.            evermind.server.rmi.RMIInitialContextFactory;             java.naming.provider.url= <PROVIDER_URL>; java.naming.security.principal=oc4jadmin; 
        java.naming.security.credentials=welcome1</value>
        </property>
          <property>
          <name>AcknowledgeMode</name>
          <value>AUTO_ACKNOWLEDGE</value>
       </property>
       <property>
         <name>IsTopic</name>
         <value>false</value>
       </property>
       <property>
         <name>IsTransacted</name>
         <value>false</value>
       </property>
       <property>
         <name>Username</name>
         <value>oc4jadmin</value>
       </property>
       </property>
       <property>
         <name>Password</name>
        <value>welcome1</value>
      </property>
     </properties>
    </connection-properties>
  </connection-instance>

where <PROVIDER_URL>=opmn://localhost:6003 or ormi://localhost:12401 to use against a specific node or, opmn:ormi://localhost:6003:oc4j_soa to use against the oc4j_soa instance.

8.4.11 Accessing Distributed Destinations (Queues and Topics) on the WebLogic Server JMS

A distributed destination is a set of destinations (queues, set of physical JMS queue members, or topics, set of physical JMS topic members) that are accessible as a single, logical destination to a client.

Note:

For more information on distributed destinations, and a definition of terms used in this context, visit the Using Distributed Destinations pages at http://download.oracle.com/docs/cd/E13222_01/wls/docs103//jms/dds.html

The JMS Adapter can process messages addressed to a distributed destination member after receiving available notification; it can process available, unavailable, and failure notifications related to a distributed destination member.To have the JMS Adapter process such messages when working with Distributed Topics, you must provide additional properties.

When you provide additional properties, you can separate multiple FactoryProperty values with a semicolon. See the following example.

<property>
  <name>FactoryProperties</name>
  <value>ClientID=SOACLient2;TopicMessageDistributionAll=true</value>
</property>

Also, in scenarios where the JMS adapter interacts with multiple WLS-managed servers in a cluster, you must specify all servers as part of the FactoryProperties property. These are in turn used to establish correct context for lookup of JMS artifacts; see the following example:

<property>
  <name>FactoryProperties</name>
  <value> java.naming.factory.initial=weblogic.jndi.
          WLInitialContextFactory; 
          java.naming.provider.url=t3://<server1>:<port1>,
               <server2>:<port2>;
          java.naming.security.principal=
               <username>;java.naming.security.credentials
                     =<password>
  </value>
</property>

Replace the brackets <> with values applicable for your environment.

8.4.11.1 Providing JMS Adapter Access to Distributed Topics

You use three FactoryProperty parameter values to provide adapter access to distributed topics, to specifically enable the Client ID to be shared by multiple connections, to enable the sharing of Durable subscriptions among multiple subscribers, and to specify whether you want one copy of a message per application or per endpoint. The properties include:

  • ClientIDPolicy

    Use the FactoryProperties parameter ClientIDPolicy property with a value of UNRESTRICTED to enable the Client ID to be shared by multiple connections. The default, if no value is specified, is UNRESTRICTED. The non-default value is RESTRICTED. The default is used in almost all cases, so typically you do not have to set it. See the following example:

    </property>
       <name>FactoryProperties</name>
    <value>ClientIDPolicy=UNRESTRICTED</value>
    
     </property>
    
  • SubscriptionSharingPolicy

    Use the FactoryProperties parameter with a value of SHARABLE to enable the sharing of Durable Subscriptions among multiple subscribers.

    A value of SubscriptionSharingPolicy EXCLUSIVE means you cannot share Durable Subscriptions among multiple subscribers. If you do not specify a value, the default is SHARABLE; in most cases, you do not have to change the value.

     <property> 
        <name>FactoryProperties</name> 
        <value>SubscriptionSharingPolicy=
                   SHARABLE</value> 
     </property>
     
  • TopicMessageDistributionAll

    See the section on Distributed Topics for more information on the TopicMessageDistributionAll FactoryProperties parameter. You can set it as in the following example:

    <property>
        <name>FactoryProperties</name>
        <value>TopicMessageDistributionAll=true</value>
    </property>
    
8.4.11.2 The JMS Adapter with Distributed Queues and Distributed Topics

Specific inbound and outbound queue and error handling behaviors apply to the JMS Adapter with WebLogic Server JMS Distributed Queues and Distributed Topics.

For inbound queues, the JMS Adapter creates an inbound poller thread and registers a notification listener with the WebLogic Server JMS on endpoint activation; it unregisters notification listener upon endpoint deactivation.

Note:

Internally, that consumer is pinned to a member of the Distributed Queue. You must deploy the adapter with a large number of threads so that all members of the distributed queues could be accounted for.

From the SOA 11.1.1.4.0 version forward, the JMS Adapter fully supports both Distributed Queues and Topics. Newer versions of the JMS Adapter rely on notifications from the WebLogic Server JMS to create and remove consumers for the Distributed Destination members.

Comparing JMS adapter behavior in SOA 11.1.1.3.0 and prior versions (where a consumer is created randomly for more than one member of Distributed Queue) with the new behavior in SOA 11.1.1.4.0 and later, there is no change, except that the JMS Adapter is now able to account for all members without relying on your starting the JMS Adapter with large numbers of poller threads at activation.

The JMS Adapter handles errors in the Distributed environment in the same fashion as such errors are handled in a non-Distributed environment: retriable exceptions lead to message retry; non-retriable exceptions lead to message rejection.

There is no change from the behavior of other Adapters to JMS adapter behavior when the Adapter produces a message to a Distributed Queue.

JMS messages for Distributed Destinations are produced by creating a MessageProducer for the Distributed Destination and not for a specific member.

Outbound errors are processed based on fault-policies previously defined for the outbound reference.

For inbound adapters with distributed topics, the JMS Adapter registers a notification listener with the WebLogic Server JMS on endpoint activation. The JMS Adapter creates an inbound poller thread for each available notification received from WebLogic Server JMS for a Distributed Topic member.

The inbound poller thread stops working and necessary cleanup is performed if an unavailable notification is received for the member for which the poller thread was created. The durable subscription is maintained in a similar fashion as in a non-Distributed topic scenario.

The Adapter unregisters the notification listener upon endpoint deactivation. Any message arriving at a Distributed Topic is processed based on the various settings used and the type of Distributed Destination in use: either one copy of a message per application, or one copy of a message per adapter endpoint.

The behaviors for each of these types of Distributed Destination follow.

8.4.11.3 One Copy of a Message Per Application (Default Behavior)

The default behavior for WebLogic Server Partitioned Distributed Topics when used with the JMS Adapter is to provide one copy of a message per application. Each message must be processed exactly once (that is, there is no duplicate processing.). In this scenario, where there is one copy of a message per application, the client id and subscription name are the same for every Distributed Destination and each adapter instance creates subscriptions on every member. The name is unique and immutable across server restarts.When using Partitioned Distributed Topics you must configure the JMS adapter to use unrestricted clientid and shared subscription policy. These two are the default settings for the JMS Adapter.When using Replicated Distributed Topics, you must configure JMS adapter to use the unrestricted clientid and shared subscription policy, which are the default settings. In addition, you must specify the following message selector, NOT JMS_WL_DDForwarded when defining an activation spec.

To achieve better performance, you should use Partitioned Distributed Topics.

Refer to the following example, consisting of a snippet of a connection instance from the weblogic-ra.xml file for a local cluster:

<property>
    <name>FactoryProperties</name>
    <value>ClientID=SOAClient1;</value>
</property>
8.4.11.4 One Copy Of a Message Per Adapter Endpoint

The second type of scenario you can employ with Distributed Topics is to have one copy of message per adapter endpoint. In this case, either the client id or the subscription name is unique for each adapter instance. The unique part of the member name is immutable across server restarts.

When using Partitioned Distributed Topics you have to configure the JMS Adapter to use unrestricted clientid and shared subscription policy, which are the default settings.

At the same time, to achieve subscription name uniqueness, the JMS Adapter requires that the property TopicMessageDistributionAll (default value of false) is set to true. You can define this property by setting the FactoryProperties property of the connection instance in the weblogic-ra.xml file.

An example usage (a snippet of a connection instance from a weblogic-ra.xml file for a local cluster) is:

<name>FactoryProperties</name>
<value>ClientID=SOAClient2;
       TopicMessageDistributionAll=true</value>
</property>

To achieve better performance, you should use Partitioned Distributed Topics.

When using Replicated Distributed Topics, configure the JMS Adapter to use unrestricted clientid and shared subscription policy, which are the default settings.

At the same time, to achieve subscription name uniqueness, the JMS adapter requires that the property TopicMessageDistributionAll (default value of false) is set to true. You can define this property by setting the FactoryProperties property of the connection instance in weblogic-ra.xml. An example usage (snippet of connection instance from weblogic-ra.xml for a local cluster) is:

<name>FactoryProperties</name>
<value> ClientID=SOAClient2;
       TopicMessageDistributionAll=true</value>
</property>

In addition, you must specify the message selector, NOT JMS_WL_DDForwarded when defining an activation spec.

8.4.11.4.1 Specifying the Message Selector when Defining an Activation Spec

Specify a message selector when defining an activation spec. The message selector is required when you create one copy of message per adapter Endpoint.

To specify the selector, use the JMS Adapter Wizard when modeling a composite application that reads from Replicated Distributed Topic The metadata for the message selector you specify are captured in the .jca file.

The following is an example of a message selector defined in an activation spec.This message selector filters out the copy of the forwarded message when sending a message to a destination subscriber.

This message selector is only applicable for when using Replicated Distributed Topics.

<activation-spec className="oracle.tip.adapter.jms.inbound.JmsConsumeActivationSpec">
     <property name="DestinationName" value="jms/DemoInTopic"/>
     <property name="UseMessageListener" value="false"/>
     <property name="DurableSubscriber" value="dsub1"/>
     <property name="MessageSelector"
                     value="NOT JMS_WL_DDForwarded"/>
     <property name="PayloadType" value="TextMessage"/>
</activation-spec>

With Distributed Topics, retriable exceptions lead to message retry, while non- retriable exceptions lead to message rejection.

Available/Unavailable/Failure notification does not impact the working of the outbound adapter reference. The message is produced by creating a MessageProducer for the Distributed Destination and not for a specific member.

In the Distributed Topics environment, as elsewhere, an error is processed based on the fault policies defined for the outbound reference.

8.4.11.4.2 Compatibility and Migration

Remote Distributed Queue support is feasible back to WLS JMS version 9.0 using the DestinationAvailabilityListener API. A remote Distributed Topic cannot be supported if it is older than WebLogic 10.3.4, as “shared subscriptions", “unrestricted client ids", the “not forwarded" selector, and even “partitioned" Distributed Topics are not supported. You must instead directly reference a DT member JNDI name, and deal with the single subscriber per subscription limitation.

8.4.12 Configuring Oracle JMS Adapter with IBM WebSphere Default JMS Provider

This section describes how to configure Oracle JMS Adapter for IBM WebSphere 7.x JMS.

  1. Copy the following files from under the <WAS_INSTALL DIR>/fmwwas-nd/websphere/runtimes directory to the SOAInstall_DIR>/user_projects/domains/<DOMAIN_NAME>/lib folder:

    • com.ibm.jaxws.thinclient_7.0.0.jar

    • com.ibm.ws.admin.client_7.0.0.jar

    • com.ibm.ws.ejb.thinclient_7.0.0.jar

    • com.ibm.ws.jpa.thinclient_7.0.0.jar

    • com.ibm.ws.messagingClient.jar

    • com.ibm.ws.orb_7.0.0.jar

    • com.ibm.ws.sib.client.thin.jms_7.0.0.jar

    • com.ibm.ws.sib.client_ExpeditorDRE_7.0.0.jar

    • com.ibm.ws.webservices.thinclient_7.0.0.jar

    • ejb3exceptions.jar

    • sibc.jmsra.rar

    • sibc.nls.zip

  2. Configure the connector factory by modifying the weblogic-ra.xml file in the soa/connectors/JmsAdapter.rar, as shown in the following example

    Example - Configure the Connection Factory

    <connection-instance>
    <jndi-name>eis/webspherejms/Queue</jndi-name>
       <connection-properties>
          <properties>
             <property>
               <name>ConnectionFactoryLocation</name>
               <value><QUEUE_CONECTION_FACTORY></value>
             </property>
             <property>
                <name>FactoryProperties</name>
                <value>java.naming.provider.
               url=iiop://<HOST_NAME>:<PORT>;
    java.naming.factory.initial=com.ibm.
               websphere.naming.WsnInitialContextFactory;
    java.naming.security.principal=<USERNAME>;
    java.naming.security.credentials=<PASSWORD>;
    ThirdPartyJMSProvider=true      
                </value>
              </property>
              <property>
                  <name>AcknowledgeMode</name>
                  <value>AUTO_ACKNOWLEDGE</value>
              </property>
              <property>
                 <name>IsTopic</name>
                 <value>false</value>
              </property>
              <property>
                 <name>IsTransacted</name>
                 <value>true</value>
             </property>
             <property>
                 <name>Username</name>
                 <value><USERNAME></value>
             </property>
             <property>
                <name>Password</name>
                <value><PASSWORD></value>
            </property>
            </properties>
        </connection-properties>
    </connection-instance>
     
    <connection-instance>
    <jndi-name>eis/webspherejms/Topic</jndi-name>
       <connection-properties>
          <properties>
             <property>
               <name>ConnectionFactoryLocation</name>
               <value><TOPIC_CONECTION_FACTORY></value>
             </property>
             <property>
                <name>FactoryProperties</name>
                <value>java.naming.provider.url=
                iiop://<HOST_NAME>:<PORT>;
    java.naming.factory.initial=com.ibm.websphere.
                naming.WsnInitialContextFactory;
    java.naming.security.principal=<USERNAME>;
    java.naming.security.credentials=<PASSWORD>;
    ThirdPartyJMSProvider=true      
                </value>
              </property>
              <property>
                  <name>AcknowledgeMode</name>
                  <value>AUTO_ACKNOWLEDGE</value>
              </property>
              <property>
                 <name>IsTopic</name>
                 <value>true</value>
              </property>
              <property>
                 <name>IsTransacted</name>
                 <value>true</value>
             </property>
             <property>
                 <name>Username</name>
                 <value><USERNAME></value>
             </property>
             <property>
                <name>Password</name>
                <value><PASSWORD></value>
            </property>
            </properties>
        </connection-properties>
    </connection-instance>
    

<QUEUE_CONECTION_FACTORY> and <TOPIC_CONECTION_FACTORY> refer to the JNDI name of the Queue and Topic connection factory, respectively created in WebSphere 7.0 for the default JMS provider.

Alternatively, you can configure a new connection factory by using the Oracle WebLogic Server Administration Console, and use the steps mentioned in Adding an Adapter Connection Factory.

Note:

The JMS Adapter can only be used in non-XA mode when interacting with WebSphere 7.x JMS.

8.4.13 Configuring Request-Reply in the JMS Adapter

The Request-Reply configuration feature enables you to perform the following:

  • Combine Request and Reply in a single configuration step. In the prior releases of the Oracle SOA Suite, you would require to configure two distinct adapters.

  • Automatic correlation without your needing to configure BPEL correlation set. This works seamlessly in Mediator and BPMN as well.

To configure the JMS Adapter Request-Reply feature:

  1. Drag and drop a JMS Adapter onto the External References swim lane in the JDeveloper composite editor.

    Figure 8-25 Dragging and Dropping a JMS Adapter into External References Swimlane

    Description of Figure 8-25 follows
    Description of "Figure 8-25 Dragging and Dropping a JMS Adapter into External References Swimlane"
  2. Enter default values for the first few screens in the JMS Configuration Adapter wizard until you reach the screen where the JMS Configuration Adapter wizard prompts you to enter the operation name. Select Request-Reply as the “Operation Type" and Asynchronous as “Operation Name".

    Figure 8-26 Operations Screen for Request/Reply

    Description of Figure 8-26 follows
    Description of "Figure 8-26 Operations Screen for Request/Reply"
  3. Select the Request and Reply queues in the following screens of the wizard. The message is enqueued in the Request queue and the reply is returned in the Reply queue.

    Figure 8-27 The Request Operation Parameters Screen

    Description of Figure 8-27 follows
    Description of "Figure 8-27 The Request Operation Parameters Screen"

    Figure 8-28 Reply Operation Parameters Screen

    Description of Figure 8-28 follows
    Description of "Figure 8-28 Reply Operation Parameters Screen"

    The reason we have used such a selector is that the back-end system that reads from the request queue and generates the response in the response queue actually generates more than one response and hence we must use a filter to exclude the unwanted responses.

  4. Select the message schema for and a response.

    Figure 8-29 Selecting Message Schema for Request and for Response

    Description of Figure 8-29 follows
    Description of "Figure 8-29 Selecting Message Schema for Request and for Response"
  5. Add an <invoke> activity in BPEL corresponding to the JMS Adapter partner link. An additional header is set as the third-party application used requires this.

    Figure 8-30 Invoke BPEL Properties Dialog Corresponding to the JMS Adapter Link

    Description of Figure 8-30 follows
    Description of "Figure 8-30 Invoke BPEL Properties Dialog Corresponding to the JMS Adapter Link "

    Add a <receive> activity just after the <invoke> activity, and select the Reply operation. Ensure that the Create Instance option is unchecked.

    Figure 8-31 Receive Dialog for Reply Operation

    Description of Figure 8-31 follows
    Description of "Figure 8-31 Receive Dialog for Reply Operation"

8.4.14 Using the WLS JMS Unit-Of-Order with the JMS Adapter

You can use the JMS Adapter to produce messages that create a specific unit-of-order for the messages. The Adapter InteractionSpec supports a property called UnitOfOrder, which you configur when modeling an adapter reference, through the Produce Operations page of the JMS Adapter Configuration Wizard. See the description of this page in Produce Message Procedure.

You use the UnitOfOrder property to set the unit-of-order value for the MessageProducer when producing a message. The new field is visible only if the JMS provider is WebLogic Server JMS.

The JMS Adapter enables you to override this unit-of-order used when producing a message to a WLS destination. To perform this override, the JMS Adapter supports a Normalized message property called jca.jms.WeblogicUnitOfOrder. This value overrides the value specified by the UnitOfOrder property for the JmsProduceInteractionSpec.

You can modify the value of the UnitOfOrder spec property from the EM console. Any outbound interactions after that point use the new value you supply.

If you define neither the property jca.jms.WeblogicUnitOfOrder nor the JmsProduceInteractionSpec property UnitOfOrder, no unit-of-order value is set by the JMS Adapter and the default unit-of-order, if specified administratively on the connection factory and destination, takes effect.

The JMS unit-of-order feature only works with the WebLogic Server. For non-WebLogic Server destinations, the property jca.jms.WeblogicUnitOfOrder (if it exists) is ignored.

8.4.14.1 Getting a Unit of Order Property

You can obtain user-specified value from the interaction spec instance.

All JMS message properties are available as Normalized Message properties. You can get the unit-of-order property by looking up the Normalized message property jca.jms.JMSProperty.JMS_BEA_UnitOfOrder on the delivered message.

8.4.15 JMS Synchronous Consume

The Oracle JMS Adapter supports the synchronous consume (mid-process receive) interaction pattern.

You can use the Adapter Configuration Wizard to model a process that enables the Oracle JMS Adapter to be used in such a synchronous consume interaction pattern. In this case, the Oracle JMS Adapter dequeues a message from a specified queue while the process is executing (hence the name mid-process receive).

If the queue is empty, execution still continues. Underneath, the Oracle JMS Adapter uses a new interaction pattern JmsReceiveNoWaitInteractionSpec.

When modeling the JMS Synchronous Consume using the JMS Adapter Configuration Wizard, you must provide the queue name used for the dequeue. For this operation, the JMS Adapter supports all the other jca properties configured when the current Consume operation is configured.

In a scenario using this operation, the BPEL Process continues executing the next step in the process if the JMS Adapter did not have any messages on the queue to dequeue.

8.4.15.1 Configuring JMS Synchronous Consume

Follow these steps to configure the JMS Synchronous Consume operation using the JMS Adapter Configuration Wizard.

  1. On the JMS Adapter Configuration Wizard Screen, select Synchronous Consume Message.

    Figure 8-32 JMS Adapter Configuration Wizard Operation Screen, with Synchronous Consume Message Selected

    Description of Figure 8-32 follows
    Description of "Figure 8-32 JMS Adapter Configuration Wizard Operation Screen, with Synchronous Consume Message Selected"
  2. The JMS Adapter Configuration Wizard Synchronous Consume Parameters Screen appears, where you can enter parameters for the Synchronous Consume Screen. Enter a Message
    • Enter a Destination Name or Select Browse to open the Destination Browser.

    • Select a Message Body Type from the Chooser. Choices are:

      • TextMessage

      • BytesMessage

      • MapMessage

    • Enter a Message Selector.

      This field is optional. It filters messages based on header and property information. The message selector rule is a Boolean expression. If the expression is true, then the message is consumed. If the expression is false, then the message is rejected.

      Some examples are supplied on the screen. For other examples, you can enter logic, such as:

      • JMSPriority > 3. Based on this, messages with a priority greater than 3 are consumed; all other messages are rejected.

      • JMSType = 'car' AND color = 'blue' AND weight > 2500

      • Country in ('UK', 'US', 'France')

    • Specify a JNDI name. This is also filled in when you select a Destination Name.

    Figure 8-33 The JMS Adapter Configuration Synchronous Consume Screen

    Description of Figure 8-33 follows
    Description of "Figure 8-33 The JMS Adapter Configuration Synchronous Consume Screen"
  3. If you selected Browse to open the Destination Browser, on this Browser:
    • Choose a Destination Type by selecting the Destination Type: All Types, Queues, or Topics.

    • Supply a Destination or click Search to search from those Destinations that populate the browser. Click Show All to show expand the list of Destinations.

    • Select a Destination, and click OK to use that Selection in the Synchronous Parameters page.

    Note:

    When using the Oracle JMS Adapter in a synchronous pattern, you can use an XA ConnectionFactory for JMS or BPEL incoming events, and set the connector factory isTransacted property to true in weblogic-ra.xml. However, if you are using a web service, ensure that you use a non-XA ConnectionFactory, and set the connector factory isTransacted property to true in weblogic-ra.xml.

    Figure 8-34 The JMS Adapter Configuration Wizard Select Destination Browser Screen

    Description of Figure 8-34 follows
    Description of "Figure 8-34 The JMS Adapter Configuration Wizard Select Destination Browser Screen"
  4. The JMS Adapter Configuration Wizard displays the JMS Adapter Messages Screen. On this screen, select Native Format is Not Required (Schema is Opaque) or browse to find a schema or open the Native Format Builder.