5 functional specification jms provider support jndi ... · functional specification jms provider...

27
Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments Date Author 1.0 Created. 07/27/2007 James D. Tran 03/13/08 Page 1 of 27 5 10 15

Upload: others

Post on 28-May-2020

16 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Functional Specification

JMS Provider SupportJNDI Support

XA In/Out Support

JMS Binding Component

DocumentVersion

Comments Date Author

1.0 Created. 07/27/2007 James D. Tran

03/13/08 Page 1 of 27

5

10

15

Page 2: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Table of Contents1 Reference......................................................................................................... 3

1.1Functional Overview.......................................................................................... 31.2Actor Inventory.................................................................................................. 3

2 Use Cases (Only the ones after Kenai are included)......................................... 4 2.1Primary Use Case.............................................................................................4

2.1.1Support for JMS Grid (Wave)................................................................42.1.2Support for Websphere MQ.................................................................. 62.1.3Support for Sonic MQ (using JNDI).......................................................82.1.4Support for JBoss MQ.........................................................................102.1.5Support for Weblogic MQ....................................................................122.1.6Support for Generic JMS with JNDI Lookup of ConnectionFactory...... 142.1.7Support for XA Recovery of JNDI based connections..........................162.1.8Support for Lookup of JNDI Destinations.............................................182.1.9Support for CC Concurrency (ConnectionConsumer)..........................212.1.10Support for Distributed Durable Subscribers..................................... 232.1.11Support for InOut XA Transactions for Consuming Endpoint.............26

03/13/08 Page 2 of 27

20

25

30

35

Page 3: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

1 Reference

1.1 Functional OverviewThe Java Messaging Service Binding Component (JMS BC) is Java Business Integration (JBI) component that provides JMS transport services to other JBI components. The JMS BC implements the JBI 1.0 component bootstrap, component life cycle, and service assembly deployment interfaces.

The JMS BC serves two major purposes or roles in the JBI environment. The first role that the JMS BC serves is a JMS service provider role. In this role, the JMS BC converts each normalized message, from the JBI message exchanges it receives, to a JMS message, and sends the JMS message to the appropriate JMS destination. From the point of view of the JMS BC, messages flow from a consumer in JBI, to the JMS BC, to the JMS server.

The other role that the JMS BC serves is a JMS external proxy consumer role. In this role, the JMS BC is a consumer of services offered by other JBI components. The consumption of these services is initiated by the in flow of JMS messages from a JMS destination. Each JMS message received by the JMS BC is converted to a normalized message and sent to the appropriate service provider in the form of a message exchange.

The design time portion of the JMS BC comprises of a set of well defined WSDL extensibility elements. These extensibility elements are used for configuring JMS connectivity and JMS message mapping. The extensibility elements can be added to the WSDL at various levels of binding. For example, when defining a binding for a particular port type, the user can add a JMS “binding” extensibility element under the general binding element: <binding><jms:binding/>...</binding>. The JMS WSDL extensibility elements is integrated to the CAPS WSDL editor. The XML schema, defining the JMS WSDL extensibility elements, is defined using the name space, “http://schemas.sun.com/jbi/wsdl-extensions/jms/”.

1.2 Actor InventoryJMS BCPartner Component (SE or BC)NMR (JBI Normalized Message Router)WSDL EditorNetBeans Component Runtime Monitor (CRM)JMS Providers (JMS Grid, Websphere MQ, etc.)

03/13/08 Page 3 of 27

5

40

45

50

55

60

65

70

Page 4: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2 Use Cases (Only the ones after Kenai are included)

2.1 Primary Use Case

2.1.1 Support for JMS Grid (Wave)Use Case Name: JMSBC-UC1 Support for JMS Grid (Wave)

Date written: 07/27/2007

Description

Support for JMS Grid: connecting to, receiving JMS Message(s) from, sending JMS Messages to.

Actors

WSDL Editor, JMS BC, JMS Grid

Preconditions & Assumptions

JMS Grid (Wave) broker is installed and running.

The following JMS Grid client library(ies) is/are installed to Glassfish (i.e., copied to lib directory):• wave.jar

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 4 of 27

75

Page 5: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports for the 2 JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the JMS Grid broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project. The user sends a JMS message to the input destination (for example, with some JMS client).

Notes on connectionURL:The URL must be of the form tcp://host:port,tcp://host:port,tcp://host:port?option1=value1&option2=value2. * The following JMS Grid protocols are supported (stream, tcp, http). * Multiple host/port combinations can be specified denoting the nodes in a cluster. These host/port combinations are propagated to the SpiritWave.messageChannels property in the WaveProfile. * Options can include options the client runtime.

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the JMS Grid (Wave) MQ instance. At runtime, the JMS BC will connect to the JMS Grid broker instance, will receive JMS message(s) from the input destination on the JMS Grid broker instance, and will send JMS message(s) to the output destination on the JMS Grid broker instance.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects JMS Grid broker instance and will send/receive JMS messages to/from destinations on the JMS Grid broker instance..

03/13/08 Page 5 of 27

80

10

Page 6: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.2 Support for Websphere MQ

Use Case Name: JMSBC-UC2 Support for Websphere MQ

Date written: 07/27/2007

Description

Support for Websphere MQ: connecting to, receiving JMS Message(s) from , sending JMS Messages to.

Actors

WSDL Editor, JMS BC, Webpshere MQ

Preconditions & Assumptions

Websphere MQ broker is installed and running.

The following Websphere MQ client library(ies) is/are installed to Glassfish (i.e., copied to lib directory):• com.ibm.mqjms.jar• com.ibm.mq.jar• com.ibm.mqetclient.jar• dhbcore.jar

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 6 of 27

Page 7: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports for the JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the Websphere MQ broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project. The user sends a JMS message to the input destination (for example, with some JMS client).

Notes on connectionURL: wmq://[hostname]:[port]?QueueManager=[queue manager name]&option1=value1&option2=value2. Options can include options:* QueueManager * TransportType * Channel

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the Websphere MQ instance. At runtime, the JMS BC will connect to the Websphere MQ broker instance, will receive JMS message(s) from the input destination on the Websphere MQ broker instance, and will send JMS message(s) to the output destination on the Websphere MQ broker instance.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects Websphere MQ broker instance and will send/receive JMS messages to/from destinations on the Websphere MQ broker instance..

03/13/08 Page 7 of 27

85

Page 8: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.3 Support for Sonic MQ (using JNDI)Use Case Name: JMSBC-UC3 Support for Sonic MQ (via JNDI)

Date written: 07/27/2007

Description

Support for Sonic MQ: connecting to, sending JMS Message(s) to , receiving JMS Messages from.

Actors

WSDL Editor, JMS BC, Sonic MQ (ver. 7.x)

Preconditions & Assumptions

Progress Sonic MQ 7.x broker is installed and running.

The following Sonic MQ client library(ies) and JNDI provider library(ies) is/are installed to Glassfish (i.e., copied to lib directory):• mfcontext.jar• sonic_Client.jar• sonic_ASPI.jar• sonic_XA.jar

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 8 of 27

15

Page 9: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports, each with a JMS address containing the connectionURL as “jndi://”. Additional JNDI information needs to be provided as described in the Notes on connectionURL below. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project. he user sends a JMS message to the input destination (for example, with some JMS client).

Notes on connectionURL:The connectionURL must be of the form “jndi:/”/ and the following JNDI related properties set accordingly:* connectionFactory=name of the connection factory bound to Sonic MQ JNDI provider (Note: It is requried that the domain of the connection factory bound to JNDI needs to match the domain of the destinationType specified in the JMS operation binding).*initialContextFactory=”com.sonicsw.jndi.mfcontext.MFContextFactory”*providerURL=Sonic MQ JNDI provider URL for the broker instance (i.e., "tcp://localhost:2506").*securityPrincipal=username to connect to JNDI (i.e., “Administrator”) *securityCredentials=password to connect to JNDI (i.e., “Administrator”)

Additionally, 2 jndienventry elements are required to specify the additonal JNDI environment entries:*name=com.sonicsw.jndi.mfcontext.domain, value=Sonic MQ domain name (i.e., “domain1”)*name=com.sonicsw.jndi.mfcontext.idleTimeout, value=6000

A JMS address element is added to each of the 2 ports in the WSDL with “jndi://” as the value of the connectionURL attribute. The JNDI specific attributes and JNDI specific elements are populated with proper values as well. At runtime, the JMS BC will connect to the Sonic MQ broker instance, will receive JMS message(s) from the input destination on the Sonic MQ broker instance, and will send JMS message(s) to the output destination on the Sonic MQ broker instance.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects Sonic MQ broker instance and will send/receive JMS messages to/from destinations on the Sonic MQ broker instance..

03/13/08 Page 9 of 27

90

Page 10: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.4 Support for JBoss MQUse Case Name: JMSBC-UC4 Support for JBoss MQ

Date written: 07/27/2007

Description

Support for JBoss MQ: connecting to, receiving JMS Message(s) from , sending JMS Messages to.

Actors

WSDL Editor, JMS BC, JBoss MQ

Preconditions & Assumptions

JBoss MQ broker is installed and running.

The following JMS Grid client library(ies) is/are installed to Glassfish (i.e., copied to lib directory):• jboss-client.jar• jbossall-client.jar• jbossmq-client.jar • jnp-client.jar

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 10 of 27 20

Page 11: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports for the JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the JBoss MQ broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project. The user sends a JMS message to the input destination (for example, with some JMS client).

Notes on connectionURL:The connectionURL is the normal JNDI url for JBoss, e.g. jnp://10.18.73.56:1099 plus a query string. The query string uses the following parameters: * xacf=. Here is the JNDI name of the XA connection factory. It defaults to UIL2XAConnectionFactory. This connection factory is used both for XA and non XA

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the JBoss MQ instance. At runtime, the JMS BC will connect to the JBoss MQ broker instance, will receive JMS message(s) from the input destination on the JBoss MQ broker instance, and will send JMS message(s) to the output destination on the JBoss MQ broker instance.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects JBoss MQ broker instance and will send/receive JMS messages to/from destinations on the JBoss MQ broker instance..

03/13/08 Page 11 of 27

Page 12: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.5 Support for Weblogic MQUse Case Name: JMSBC-UC5 Support for Weblogic MQ

Date written: 07/27/2007

Description

Support for Weblogic MQ: connecting to, sending JMS Message(s) to , receiving JMS Messages from.

Actors

WSDL Editor, JMS BC, Weblogic MQ

Preconditions & Assumptions

Weblogic MQ broker is installed and running.

The following Weblogic MQ client library(ies) is/are installed to Glassfish (i.e., copied to lib directory):• wlclient.jar• wljmsclient.jar

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 12 of 27

95

Page 13: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports for the JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the Weblogic MQ broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project. The user sends a JMS message to the input destination (for example, with some JMS client).

Notes on connectionURL:The connectionURL is identical to the WebLogic URL plus a query string. The query string uses the following parameters: * JMSJCA.WLFACTORY=. Here is the JNDI name of the XA connection factory via the “xacf” query option; if not specified, it defaults to “weblogic.jms.XAConnectionFactory”. This connection factory is used both for XA and non XA (eventhough XA is emulated)* prefix=. This is the prefix used for looking up destinations.

Example: t3://blue:7001?xacf=myxa&prefix=jms/destinations

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the Weblogic MQ broker instance. At runtime, the JMS BC will connect to the Weblogic MQ broker instance, will receive JMS message(s) from the input destination on the Weblogic MQ broker instance, and will send JMS message(s) to the output destination on the Weblogic MQ broker instance.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects Weblogic MQ broker instance and will send/receive JMS messages to/from destinations on the Weblogic MQ broker instance..

03/13/08 Page 13 of 27

25

Page 14: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.6 Support for Generic JMS with JNDI Lookup of ConnectionFactoryUse Case Name: JMSBC-UC6 Support for Generic JMS with JNDI ConnectionFactory

Date written: 07/27/2007

Description

Support for Generic MQ via JNDI lookup of connection factory(ies): connecting to, sending JMS Message(s) to , receiving JMS Messages from.

Actors

WSDL Editor, JMS BC, JNDI provider, JMS Provider

Preconditions & Assumptions

The JMS provider broker instance is installed and running.

The JMS provider client runtime library(ies) is/are installed to Glassfish (e.g., copied to lib directory).

The JNDI provider library (jar) is installed to Glassfish (e.g., copied to lib directory).

A JMS ConnectionFactory (Queue or Topic) is bound to JNDI.

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 14 of 27

100

Page 15: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports, each with a JMS address containing the connectionURL as “jndi://”. The required values in the JNDI related attributes for selected JNDI provider are also filled out appropriately. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project.

Some suggestions for JNDI provider and JMS provider include (but not limited to):* JNDI File provider & Sun Java MQ* Sonic MQ JNDI provider & Sonic MQ

Notes on connectionURL:The connectionURL must be of the form “jndi:/”/ and the following JNDI related properties set accordingly:* connectionFactory=name of the connection factory bound to the JNDI provider (Note: It is requried that the domain of the connection factory bound to JNDI needs to match the domain of the destinationType specified in the JMS operation binding).*initialContextFactory=the JNDI initial context factory class for the JNDI provider*providerURL=the JNDI provider URL for the broker instance (i.e., "tcp://localhost:2506").*securityPrincipal=username to connect to JNDI provider *securityCredentials=password to connect to JND provider

Additionally, use the jndienv and jndienventry elements to specify the additonal JNDI environment entries.

A JMS address element is added to each of the 2 ports in the WSDL with the connectionURL as “jndi://” and the JNDI related attributes/elements are properly filled out. At runtime, the JMS BC will connect to the configured JMS broker instance, will receive JMS message(s) from the input destination on the configured JMS broker instance, and will send JMS message(s) to the output destination on the configured JMS broker instance.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects to the JMS broker as configured for the connection factory, will send/receive JMS message(s) to/from the destinations on the JMS broker instance.

03/13/08 Page 15 of 27 30

Page 16: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.7 Support for XA Recovery of JNDI based connectionsUse Case Name: JMSBC-UC7 Support for XA recovery of JNDI based connections

Date written: 07/27/2007

Description

Recovery of XA transaction(s) upon restart of the JMS BC during “crash” recovery in Glassfish.

Actors

WSDL Editor, JMS BC, JNDI Provider, JMS Provider

Preconditions & Assumptions

2 (or more) JMS provider broker instance(s) are installed and running.

The JMS provider client runtime library(ies) is/are installed to Glassfish (e.g., copied to lib directory).

The JNDI provider library (jar) is installed to Glassfish (e.g., copied to lib directory).

2 (or more) JMS ConnectionFactories (Queue or Topic) is bound to JNDI.

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 16 of 27

105

Page 17: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, the user creates 2 ports, each with a JMS address containing the JNDI related attributes for the selected JNDI providers properly filled out; the connectionURL for each port is “jndi://”. One port is used as a consuming endpoint and the other port is used as a provisioning endpoint in a Java EE EJB web service. The user deploys the Java EE EJB web service project. In the middle of an XA transaction initiated by the consuming endpoint, the Glassfish instance running the deployment crashes. The Glassfish application server instance is restarted.

Some suggestions for JNDI provider and JMS provider include (but not limited to):* JNDI File provider & Sun Java MQ* Sonic MQ JNDI provider & Sonic MQ

Notes on connectionURL:The connectionURL must be of the form “jndi:/”/ and the following JNDI related properties set accordingly:* connectionFactory=name of the connection factory bound to the JNDI provider (Note: It is required that the domain of the connection factory bound to JNDI needs to match the domain of the destinationType specified in the JMS operation binding).*initialContextFactory=the JNDI initial context factory class for the JNDI provider*providerURL=the JNDI provider URL for the broker instance (i.e., "tcp://localhost:2506").*securityPrincipal=username to connect to JNDI provider *securityCredentials=password to connect to JND provider

Additionally, use the jndienv and jndienventry elements to specify the additonal JNDI environment entries.

A JMS address element is added to each of the 2 ports in the WSDL with the JNDI related attributes properly filled out for each one. At runtime, the JMS BC looks up the connection factories at the JNDI provider URLs specified for the selected JNDI providers for each port. It will receive from the destination on the JMS provider as specified for the consuming endpoint and it will send to the destination on the JMS provider as specified for the provisioning endpoint. The receive and send will be in a single XA transaction. Upon restart of Glassfish server instance crash, recovery of the XA transaction will rollback or commit the transaction. If the trasnaction is rolled back, the message is reprocessed. If committed, the message is sent and committed on the output destination for the provisioning endpoint.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects to the JMS broker as configured for the connection factory.

03/13/08 Page 17 of 27

Page 18: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.8 Support for Lookup of JNDI DestinationsUse Case Name: JMSBC-UC8 Support for lookup of JNDI Destinations

Date written: 07/27/2007

Description

Support for JNDI lookup of JMS destinations.

Actors

WSDL Editor, JMS BC, JNDI provider, JMS Provider

Preconditions & Assumptions

The JMS provider broker instance is installed and running.

The JMS provider client runtime library(ies) is/are installed to Glassfish (e.g., copied to lib directory).

The JNDI provider library (jar) is installed to Glassfish (e.g., copied to lib directory).

A JMS ConnectionFactory (Queue or Topic) is bound to JNDI.

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.

The JMS input and output destinations are bound to JNDI.Basic Flow

User Action System Action

03/13/08 Page 18 of 27

35110

Page 19: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, specify the destinations in each of the JMS operations, in the 2 bindings, as JNDI destination names. The value of the destination must be prefixed with “jndi://” (for example, “jndi://MyInputQueue”). Note: It is required that the domain of the destination bound to JNDI needs to match the domain of the destinationType specified in the JMS operation binding.

Using the WSDL editor, the user creates 2 ports, each with a JMS address containing the connectionURL as “jndi://”. The required values in the JNDI related attributes for selected JNDI provider are also filled out appropriately. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project.

Some suggestions for JNDI provider and JMS provider include (but not limited to):* JNDI File provider & Sun Java MQ* Sonic MQ JNDI provider & Sonic MQ

Notes on connectionURL:The connectionURL must be of the form “jndi:/”/ and the following JNDI related properties set accordingly:* connectionFactory=name of the connection factory bound to the JNDI provider (Note: It is required that the domain of the connection factory bound to JNDI needs to match the domain of the destinationType specified in the JMS operation binding).*initialContextFactory=the JNDI initial context factory class for the JNDI provider*providerURL=the JNDI provider URL for the broker instance (i.e., "tcp://localhost:2506").*securityPrincipal=username to connect to JNDI provider *securityCredentials=password to connect to JND provider

Additionally, use the jndienv and jndienventry elements to specify the additonal JNDI environment entries.

The value of the destination attribute of each of the JMS operations in the 2 bindings will be in the form “jndi://ddd”, where “ddd” is the JNDI name of the destination.

A JMS address element is added to each of the 2 ports in the WSDL with the connectionURL as “jndi://” and the JNDI related attributes/elements are properly filled out. At runtime, the JMS BC will connect to the configured JMS broker instance, will lookup the destinations in the JNDI provider for the input and output destinations. It will receive JMS message(s) from the input destination on the configured JMS broker instance, and will send JMS message(s) to the output destination on the configured JMS broker instance.

Error Flow

User Action System Action

03/13/08 Page 19 of 27

Page 20: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Post ConditionsThe JMS BC connects to the JMS broker as configured for the connection factory, will lookup the destinations from JNDI, will send/receive JMS message(s) to/from the destinations on the JMS broker instance.

03/13/08 Page 20 of 27 40

Page 21: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.9 Support for CC Concurrency (ConnectionConsumer)Use Case Name: JMSBC-UC9 Support for CC Concurrency (ConnectonConsumer)

Date written: 07/27/2007

Description

Provides for concurrent processing by using connection consumer mode. Messages may be processed out of order.

Actors

WSDL Editor, JMS BC, JMS Provider

Preconditions & Assumptions

JMS broker instance is installed and running (i.e., Sun Java MQ). The JMS provider used MUST support ConnectionConsumer.

The JMS provider client library(ies) are installed to Glassfish (e.g., copied to lib directory).

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 21 of 27

115

Page 22: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, specify the destinationType for the JMS binding operation, of the binding used as the consuming endpoint, as “Topic”.

Using the WSDL editor, specify the concurrencyMode of the JMS binding operation, of the binding used as the consuming endpoint, as “cc”.

Using the WSDL editor, the user creates 2 ports for the 2 JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the appropriate JMS broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project. The user sends a JMS message to the input destination (for example, with some JMS client).

The value of the destinationType attribute for the JMS operation, of the binding used as the consuming endpoint, will have the value “Topic”.

The value of the concurrencyMode attribute for the JMS operation, of the binding used as the consuming endpoint, will have the value “cc”.

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the JMS broker instance. At runtime, the JMS BC will connect to the JMS broker instance, will receive JMS message(s) from the input destination on the JMS broker instance using a ConnectionConsumer, and will send JMS message(s) to the output destination on the JMS broker instance. Increased throughput should be observed when comparing to concurrencyMode set to “sync”.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects JMS broker instance and will send/receive JMS messages to/from destinations on the JMS broker instance. Increased throughput should be observed when comparing to concurrencyMode set to “sync”.

03/13/08 Page 22 of 27

Page 23: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.10 Support for Distributed Durable SubscribersUse Case Name: JMSBC-UC10 Support for Distributed Durable Subscribers

Date written: 07/27/2007

Description

Provides support for load balancing for Topics when native support is not provided by the JMS provider and the service assembly is deployed to a clustered Glassfish environment. There will be one active durable subscriber on one of the nodes in the cluster; this active durable subscriber will receive messages from the Topic and send them to a Queue. At the same time, message consumers will read messages from the Queue in all the nodes which the service assembly is deployed. In addition, each of the other (non-active durable subscriber) nodes tries continuously to become the active subscriber, so in case of failure of the active subscriber, another cluster node will become the active subscriber automatically.

Actors

WSDL Editor, JMS BC, JMS Provider

Preconditions & Assumptions

JMS broker instance is installed and running (i.e., Sun Java MQ).

Clustered Glassfish with 2 or more nodes is installed and running.

The JMS provider client library(ies) are installed to Glassfish (e.g., copied to lib directory).

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operations are InOnly operations.Basic Flow

User Action System Action

03/13/08 Page 23 of 27

45120

Page 24: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, specify the destinationType for the JMS binding operation, of the binding used as the consuming endpoint, as “Topic”.

Using the WSDL editor, specify the subscriptionDurability of the JMS binding operation, of the binding used as the consuming endpoint, as “Durable”.

Using the WSDL editor, provide the values of the subscriptionName in the following special format:

jmsjca://distribution=1&subscribername=s[&queue=q][&mbeanname=m][&batchsize=b]

Where the following parameters are,* distribution – turns on distributed durable subscribers. Valid values: “0”=off, “1”=distributed durable subscriber; default is 0; this is a required parameter.* subscribername - the name of the durable subscriber; this is a required parameter.* queue – the name of the queue to send the messages to; default is “dt-topic-subscribername”; this is an optional parametner.* mbeanname - name of the MBean associated with the topic-to-queue delivery object; default is specified MBean name + "-dt"; this is an optional parameter.* Batchsize - number of messages read in one batch from the topic and written to the queue; default is 10; this is an optional parameter.Sample,“jmsjca://distribution=1&subscribername=MySub&queue=MyLBQueue”

Using the WSDL editor, the user creates 2 ports for the 2 JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the appropriate JMS broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The user deploys the Java EE EJB WebService CompApp project to the cluster. The user sends JMS messages to the input destination; each JMS message contains a unique ID for a payload.

The value of the destinationType attribute for the JMS operation, of the binding used as the consuming endpoint, will have the value “Topic”.

The value of the subscriptionDurability attribute for the JMS operation, of the binding used as the consuming endpoint, will have the value “Durable”.

The value of the subscriptionName attribute for the JMS operation, of the binding used as the consuming endpoint, will have a the subscription name specified.

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the JMS broker instance. At runtime, the JMS BC will connect to the JMS broker instance. One active durable subscriber will receive all messages from the configured Topic. The messages will be sent to the Queue specified in the special subscriptionName format (or the default queue if one is not specified). Then all messages will received from this Queue by the message consumers from all of the nodes where the SA is deployed. The messages read from this queue will be sent to the output destination on the JMS broker instance. Observe that there should be no duplicate messages in the output destination.

03/13/08 Page 24 of 27

Page 25: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects JMS broker instance and will send/receive JMS messages to/from destinations on the JMS broker instance. There should be no duplicate messages on the output destination.

03/13/08 Page 25 of 27 50

Page 26: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

2.1.11 Support for InOut XA Transactions for Consuming EndpointUse Case Name: JMSBC-UC11 Support for InOut XA Transactions for Consuming Endpoint

Date written: 07/27/2007

Description

Provides for the start of an XA transaction and propagation of the XA transaction in an InOut message exchange when the JMS BC is a consuming endpoint (inbound).

Actors

WSDL Editor, JMS BC, JMS Provider

Preconditions & Assumptions

JMS broker instance is installed and running (i.e., Sun Java MQ).

The JMS provider client library(ies) are installed to Glassfish (e.g., copied to lib directory).

A JavaEE EJB WebService project is already created which uses JMS BC to receive JMS message(s) and JMS BC to send JMS message(s).

A WSDL is created with 2 port types and 2 bindings; all the JMS bindings are already defined in the WSDL in the JavaEE EJB WebService project. One binding has JMS operation that receives from an input destination and the other binding has a JMS operation that sends to an output destination. The operation for the consuming endpoint is an InOut operation; the operation for the provisioning endpoint is an InOnly operation.Basic Flow

User Action System Action

03/13/08 Page 26 of 27

125

Page 27: 5 Functional Specification JMS Provider Support JNDI ... · Functional Specification JMS Provider Support JNDI Support XA In/Out Support JMS Binding Component Document Version Comments

Using the WSDL editor, specify the transaction attribute for the JMS binding operation, of the binding used as the consuming endpoint, as “XATransaction”.

Using the WSDL editor, the user creates 2 ports for the 2 JMS bindings. Both ports contain a JMS address with the connectionURL attribute specifying the connection to the appropriate JMS broker instance. One port is used as a consuming endpoint and the other as a provisioning endpoint in a Java EE EJB WebService project. The EJB should return some message as the response for the web service operation it is implementing. The user deploys the Java EE EJB WebService CompApp project. The user sends a JMS message to the input destination (for example, with some JMS client).

The value of the tra attribute for the JMS operation, of the binding used as the consuming endpoint, will have the value “XATransaction”.

A JMS address element is added to each of the 2 ports in the WSDL, each with the connectionURL attribute properly filled out (correct form) for connecting to the JMS broker instance. At runtime, the JMS BC will connect to the JMS broker instance, will start an XA transaction, will receive JMS message(s) from the input destination on the JMS broker instance, will propagate the XA transaction to the EJB, will send JMS message(s) to the output destination on the JMS broker instance, will receive the response from the EJB (JavaEE SE), will send the response to the JMSReplyTo destination, and will complete the XA transaction.

Error Flow

User Action System Action

Post ConditionsThe JMS BC connects JMS broker instance and will send/receive JMS messages to/from destinations on the JMS broker instance. The JMS BC should start an XA transaction, propagate the transaction in the InOut message exchange, send back a response to the JMSReplyTo destination (from the received JMS Message), and complete the XA transaction.

03/13/08 Page 27 of 27

130