Anda di halaman 1dari 12

Web Service Interactions using JMS

April 2008

JMS Transport Architecture


ActiveVOS Engine

BPEL Engine

BPEL Process
Inbound Service Request Flow

Default
Receive
Handler

SOAP
Receive
Handler

WSRM
Receive
Handler

Default
Invoke
Handler

XML
Receive
Handler

Process
Invoke
Handler

EJB
Invoke
Handler

Java
Invoke
Handler

JMS
Invoke
Handler
Outbound Service Invoke Flow

Invoke Handler Factory

Receive Handler Factory

Invocation Handler

Receive Handler

Async
Listeners

Message
Consumers

Transaction
Manager

JMS Transport Factories


Messaging Manager

JMS Provider

Active Endpoints

Message
Producers

Entity Instantiation

Connecting to JMS Providers


Interactions with external JMS providers are handled through a
JMS Manager instance
Each manager is configured with a set of settings used to
establish connections with a particular JMS server

Any number of named configurations can be specified to support


connections with multiple JMS servers
One configuration can be specified as the default. This
configuration is used unless another configuration is specified in
policy.

Active Endpoints

Messaging Manager Configurations

A Messaging Manager configuration represents the set of properties


and settings needed to communicate with an external JMS provider

JMS Provider Type


list of configuration templates that contain some pre-defined default settings for the
type of JMS provider being used.
Theoretically, any provider that provides JNDI access to JMS resources can be
used with our product. If the specific provider is not on the list, users should
choose Other JMS and set the initial context properties as appropriate.
Users will need to make sure the client libraries are available on the classpath

Tested Configurations
BEA Weblogic
JBoss MQ
IBM MQ Series

Active Endpoints

Messaging Manager Configurations

Connection Factory Name


JNDI name of the JMS connection factory.

Initial Context Properties


set of name-value pairs used to establish a JNDI context to the server
Values are provider-specific.

Active Endpoints

BPEL Engine Listeners

To receive messages over JMS transport, there needs to be at least one


listener bound to a JMS destination on the server to dispatch incoming
messages to the engine
Users can configure asynchronous listeners on both queues and topics
within any messaging configuration
The following properties are used to configure the destination and
listener class:
Queue Name/Topic Name

descriptive name for the configuration

JNDI Location

location name used for JNDI lookups

Listener Class

Message listener class name

Selector

JMS message selector string

Default Service Name

Active Endpoints

Specifies the name of the BPEL service to use when the target service cannot be
determined from the addressing headers or message properties.

Supported Message Exchanges


Supported Message Formats:
SOAP

Serialized SOAP Envelope as message payload

XML Request and Response documents as plain XML with no SOAP


envelope.

Plain

Supported JMS Message Types:


Text

Message contents serialized as xml text

Bytes

Message contents serialized as a byte array

Supported MEP:
One-Way

Request

Request-Response

with durable reply destination

Request-Response

with temporary reply destination

Active Endpoints

JMS Invoke Handler & Endpoints

To send a request using JMS Transport, specify jms as the


invoke handler.

The <wsa:Address> for the endpoint needs to indicate the target destination (queue or topic)
and, optionally, the service name
formatted as <destination JNDI name>?<service name>
The JNDI name is used to lookup the destination from the JMS provider
The service name is optional, depending on the type of receiver you are invoking
<partnerRole endpointReference="static" invokeHandler="jms:Address">
<wsa:EndpointReference>
<wsa:Address>queue/com.activee.jms.bpel.queue?JMSOneWayService</wsa:Address>
</wsa:EndpointReference>
</partnerRole>
The above partnerRole will result in the following
JMS Message Type = Text
Message Format = SOAP
Default JMS Manager

Active Endpoints

JMS Message Policy


The options used for sending a JMS request are controlled through WS-Policy
assertions on the endpoint
jmsMessageType
Text (default)

Bytes

jmsMessageFormat
SOAP (default)
XML

jmsPriority
Integer value indicating the message priority

jmsManagerID
Name of JMS manager configuration to use.

jmsCorrelationID
Allows users to set the message correlation id. By default the GUID from
wsa:MessageID is used.

jmsExpiration
Time, in milliseconds, that a message expires

Active Endpoints

JMS Partner Role for Request-Response

If the operation is two-way, the receiver needs to send a reply and


the sender needs to tell the receiver where to send it using WSAddressing.

If no reply information is provided, the JMS invoker will create a


temporary queue destination to receive the reply.
standard JMS mechanism for supporting two way exchanges where the
response does not need to be durable

exists only for the duration of the invoke


messages are not persisted
no correlation information is necessary

To specify a durable reply destination, you need to provide a


permanent destination name as a wsa:ReplyTo endpoint
<wsa:ReplyTo>
<wsa:Address>queue/com.activee.jms.reply.queue</wsa:Address>

</wsa:ReplyTo>

10

Active Endpoints

Setting & Accessing JMS Message Properties

Additional JMS message properties are defined as abx:param elements under


wsa:ReferenceProperties on the partner endpoint

<wsa:EndpointReference>
<wsa:Address>queue/com.activee.jms.bpel.queue?JMSOneWayService</wsa:Address>
<wsa:ReferenceParameters>
<wsa:ReplyTo>
<wsa:Address>queue/com.activee.jms.bpel.queue?JMSCallbackService</wsa:Address>
</wsa:ReplyTo>
<abx:param name=someProperty value=value/>
</wsa:ReferenceParameters>
</wsa:EndpointReference>

11

JMS Message properties from an inbound receive are available to the process using the
abx:getMyRoleProperty function

Active Endpoints

Questions

12

Active Endpoints

Anda mungkin juga menyukai