To deploy messaging applications that use the Java™ Messaging Service (JMS), you must add the wasJmsServer-1.0 and wasJmsClient-1.1 features
to the server.xml file, and define the connection
factory and destination properties. If you want to perform a JNDI
lookup, then you must add the jndi-1.0 feature along
with the other two features.
About this task
The wasJmsServer-1.0 feature
provides support for applications that use Java Messaging Service 1.1 specifications.
Procedure
- Add the wasJmsServer-1.0, wasJmsClient-1.1,
and jndi-1.0 features to the server.xml file.
<featureManager>
<feature>wasJmsServer-1.0</feature>
<feature>wasJmsClient-1.1</feature>
<feature>jndi-1.0</feature>
</featureManager>
- Add the destination definitions to the server.xml file.
<messagingEngine>
<queue id="QUEUE1"> </queue>
</messagingEngine>
- Optional: Add the <wasJmsEndpoint> element
to enable the JMS messaging engine to accept the remote incoming messaging
connections from TCP/IP (with and without SSL).
<wasJmsEndpoint id="InboundJmsEndpoint"
host="*"
wasJmsPort="7276"
wasJmsSSLPort="9100">
</wasJmsEndpoint>
Note: Adding <wasJmsEndpoint> is
optional. By default, the Liberty profile enables messaging engine
to listen on 7276 port (unsecured) and 7286 (secured). If you want
to specify a different port, then <wasJmsEndpoint> can be configured.
- Add the connection factory definitions to the server.xml file.
- For Point-to-Point domain:
<jmsQueueConnectionFactory jndiName="jndi_JMS_BASE_QCF">
<properties.wasJms
remoteServerAddress="localhost:7276:BootStrapBasicMessaging" />
</jmsQueueConnectionFactory>
<jmsQueue jndiName="jndi_INPUT_Q">
<properties.wasJms queueName="QUEUE1" />
</jmsQueue>
- For Publish-Subscribe domain:
<jmsTopicConnectionFactory jndiName="eis/tcf">
<properties.wasJms
clientID="defaultID" />
</jmsTopicConnectionFactory>
<jmsTopic jndiName="eis/topic1">
<properties.wasJms topicName="Football" />
</jmsTopic>
The JMS applications are now connected to
the embedded messaging server.