Deploying JMS applications to connect to the embedded messaging server

To deploy messaging applications that use the Java™ Messaging Service (JMS), you must add the wasJmsServer-1.0 and wasJmsClient-2.0 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.

Before you begin

Ensure that a Liberty server is created on which you want to deploy the messaging application that uses JMS. For more information, see Creación manual de un servidor de Liberty.

Important: La característica wasJmsClient-2.0 admite las características de las especificaciones JMS 1.1 y JMS 2.0. Sin embargo, puede decidir utilizar la característica wasJmsClient-1.1 si desea utilizar solamente las características que son compatibles con la especificación JMS 1.1.

About this task

The wasJmsServer-1.0 feature provides support for applications that use Java Messaging Service 1.1 specifications.

Procedure

  1. Add the wasJmsServer-1.0, wasJmsClient-2.0, and jndi-1.0 features to the server.xml file.
    <featureManager>
        <feature>wasJmsServer-1.0</feature>
        <feature>wasJmsClient-2.0</feature>
        <feature>jndi-1.0</feature>
    </featureManager>
  2. Add the destination definitions to the server.xml file.
    <messagingEngine>
        <queue id="QUEUE1"> </queue>
    </messagingEngine>
  3. 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
        host="*"
        wasJmsPort="7276"
        wasJmsSSLPort="9100">
    </wasJmsEndpoint>
    Note: Adding <wasJmsEndpoint> is optional. By default, the Liberty server 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.
  4. 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.

Icono que indica el tipo de tema Tema de tarea



Icono de indicación de fecha y hora Última actualización: Tuesday, 6 December 2016
http://www14.software.ibm.com/webapp/wsbroker/redirect?version=cord&product=was-nd-mp&topic=twlp_dep_msg_embedded
Nombre de archivo:twlp_dep_msg_embedded.html