WAS v6.1 supports the use of third-party JMS providers within its runtime environment through the use of a generic JMS provider. A generic JMS provider must be defined to WAS before any JMS resources can be configured for that provider.
Defining a generic JMS provider to WAS ensures that the JMS provider classes are available on the application server classpath at runtime.
WAS interaction with a generic JMS provider –
The JMS administered objects for a generic JMS provider are bound into the local JNDI name space within WebSphere Application Server. These JNDI entries act as aliases to the real JMS administered objects that have been configured in the external JNDI name space of the messaging provider.
This indirection is achieved by providing additional JNDI information when configuring the JMS administered objects for the generic JMS provider. JMS client application code is not affected in any way. It is the responsibility of the WebSphere runtime to resolve accesses to the real JNDI entries in the external name space.
WebSphere is not responsible for binding the JMS administered objects into the external name space. This administrative task, along with creating the underlying messaging objects, queues, and topics, must be performed using the tools provided by the generic JMS provider.
Configuring a JMS provider for a third party non-JCA messaging provider:
- Start the administrative console.
- In the navigation pane, click Resources > JMS->JMS providers. The existing messaging providers are displayed, including the default messaging provider and the WebSphere MQ messaging provider.
- To define a new third-party non-JCA messaging provider, click New in the content pane. Otherwise, to change the definition of an existing messaging provider, click the name of the provider.
- Specify the following required properties. You can specify other properties, as described in a later step.
Name: The name by which this messaging provider is known for administrative purposes within WebSphere Application Server.
External initial context factory: The Java classname of the initial context factory for the JMS provider.
External provider URL: The JMS provider URL for external JNDI lookups.
5. Optional: Click Apply. This enables you to specify additional properties.
6. Click OK
7. Save the changes to the master configuration.
Configuring a JMS connection factory for a third party non-JCA messaging provider:
- Display the third-party non-JCA messaging provider. In the navigation pane, click Resources > JMS->JMS providers.
- Select the third-party non-JCA messaging provider for which you want to configure a connection factory.
- Optional: Select the Scope setting corresponding to the scope of the connection factories that you want to view or change.
- In the content pane, under Additional Properties, click Connection factories This displays a table listing any existing JMS connection factories, with a summary of their properties.
- To browse or change an existing JMS connection factory, click its name in the list. Otherwise, to create a new connection factory, complete the following steps:
- Click New in the content pane.
- Specify the following required properties. You can specify other properties, as described in a later step.
Name: The name by which this JMS connection factory is known for administrative purposes within IBM® WebSphere® Application Server.
Type: Select whether the connection factory is for JMS queues (QUEUE) or JMS topics (TOPIC).
JNDI Name: The JNDI name that is used to bind the JMS connection factory into the WebSphere Application Server namespace.
External JNDI Name: The JNDI name that is used to bind the JMS connection factory into the namespace of the messaging provider.
C. Click Apply. This defines the JMS connection factory to WebSphere Application Server, and enables you to browse or change additional properties.
6. Click OK.
7. Save any changes to the master configuration.
Configuring a JMS destination for a third party non-JCA messaging provider:
- Start the administrative console.
- In the navigation pane, click Resources > JMS->JMS providers.
- Click the name of the third-party non-JCA messaging provider.
- In the content pane, under Additional Properties, click Queues for point-to-point messaging or Topics for publish/subscribe messaging.This displays a table listing any existing JMS destinations, with a summary of their properties.
- To browse or change an existing JMS destination, click its name in the list. Otherwise, to create a new destination, complete the following steps:
- Click New in the content pane.
- Specify the following required properties. You can specify other properties, as described in a later step.
Name: The name by which this JMS destination is known for administrative purposes within WebSphere Application Server.
Type: Select whether the destination is for JMS queues (QUEUE) or JMS topics (TOPIC).
JNDI Name: The JNDI name that is used to bind the JMS destination into the WebSphere Application Server namespace.
External JNDI Name: The JNDI name that is used to bind the JMS destination into the namespace of the messaging provider.
- Click Apply. This defines the JMS destination to WebSphere Application Server, and enables you to browse or change additional properties.
6. Click OK.
7. Save any changes to the master configuration.
Set custom property for the JMS destination:
Set custom properties of the provider to map external JNDI names. Below is just for illustration & ease of reference purpose:
– java.naming.connectionFactoryNames = ConnectionFactory
– java.naming.queue.MyQueue = MyQueue
– java.naming.topic.MyTopic = MyTopic
Managing message listener resources for message-driven beans:
- Start the administrative console.
- In the navigation pane, click Servers > Server Types > WebSphere application servers->server_name > [Communications] Messaging > Message listener service > [Additional Properties] Listener Ports > listener_port
- Select the name of the listener port that you want to work with. This displays the properties of the listener port in the content pane.
- Click OK.
- Save your changes to the master configuration.
- To have a changed configuration take effect, stop then restart the application server.
Create a Message Listener Port for message-driven beans. Below is just for illustration & ease of reference purpose:
– Set the connection factory JNDI, e.g. “ConnectionFactory”
– Set the destination JNDI, e.g. “MyTopic”
In the MDB project’s “ibm-ejb-jar-bnd.xmi” file, refer to the above message listener as –
<?xml version="1.0" encoding="UTF-8"?> <ejbbnd:EJBJarBinding xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ejb="ejb.xmi" xmlns:ejbbnd="ejbbnd.xmi" xmi:id="EJBJarBinding_1416464607405"> <ejbJar href="META-INF/ejb-jar.xml#ejb-jar_ID"/> <ejbBindings xmi:type="ejbbnd:MessageDrivenBeanBinding" xmi:id="MessageDrivenBeanBinding_1416464607406" listenerInputPortName="AMQ_JMS_TopicPort"> <enterpriseBean xmi:type="ejb:MessageDriven" href="META-INF/ejb-jar.xml#SampleMDB"/> </ejbBindings> </ejbbnd:EJBJarBinding>