Este contenido no está disponible en el idioma seleccionado.

38.2.3. Dedicated Remote Server


Example 38.5. Remote JCA Server

In this example, the HornetQ live instance is stored on a remote server EAP1. The backup HornetQ instance is stored on EAP1(B). The JCA and the Applications are stored on a separate EAP2 instance.
When fail over occurs, the Application (via JCA) is serviced by a HornetQ server in its own JBoss Enterprise Application Platform instance.
Because both HornetQ instances are located on remote servers, you must configure the JCA connection factories on the EAP2 server to correctly serve applications to the live HornetQ server and the backup HornetQ server.

Procedure 38.12. Configure JCA Connection Factories

Follow this procedure to configure the Outbound and Inbound JCA connector elements in different configuration files. Ensure you copy the Key steps are identified by a step title.
  1. Copy the production server profile, and rename it to EAP2.
  2. On the EAP2 instance, navigate to $JBOSS_HOME/server/EAP2/deploy/hornetq/jms-ds.xml
  3. The default jms-ds.xml has the following <config-property> configuration present in the <tx-connection-factory>.
    <?xml version="1.0" encoding="UTF-8"?>
    <connection-factories>
       <!-- JMS Stuff -->
    
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader" 
        name="hornetq:service=JMSProviderLoader,name=JMSProvider">
          <attribute name="ProviderName">DefaultJMSProvider</attribute>
          <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
          <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
          <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
          <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       </mbean>
       
       <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
    
       <tx-connection-factory>
          <jndi-name>JmsXA</jndi-name>
          <xa-transaction/>
          <rar-name>jms-ra.rar</rar-name>
          <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
          <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
          <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
          <max-pool-size>20</max-pool-size>
          <security-domain-and-application>JmsXARealm</security-domain-and-application>
       </tx-connection-factory>
    </connection-factories>
    
    Copy to Clipboard Toggle word wrap
  4. Configure Outbound JCA Connector

    Add extra <config-property> elements as described in the following code sample.

    Important

    Substitute the [live_server_IP_address] and [live_server_port_number] with the network address locations for your live server.
    If you are using Discovery to set IP address/port combinations, ensure you set the appropriate parameters for <DiscoveryAddress> and <DiscoveryPort> to match your configured broadcast groups.
    <?xml version="1.0" encoding="UTF-8"?>
    <connection-factories>
       <!-- JMS Stuff -->
    
       <mbean code="org.jboss.jms.jndi.JMSProviderLoader" 
        name="hornetq:service=JMSProviderLoader,name=JMSProvider">
          <attribute name="ProviderName">DefaultJMSProvider</attribute>
          <attribute name="ProviderAdapterClass">org.jboss.jms.jndi.JNDIProviderAdapter</attribute>
          <attribute name="FactoryRef">java:/XAConnectionFactory</attribute>
          <attribute name="QueueFactoryRef">java:/XAConnectionFactory</attribute>
          <attribute name="TopicFactoryRef">java:/XAConnectionFactory</attribute>
       </mbean>
       
       <!-- JMS XA Resource adapter, use this to get transacted JMS in beans -->
    
       <tx-connection-factory>
          <jndi-name>JmsXA</jndi-name>
          <xa-transaction/>
          <rar-name>jms-ra.rar</rar-name>
          <connection-definition>org.hornetq.ra.HornetQRAConnectionFactory</connection-definition>
          <config-property name="SessionDefaultType" type="java.lang.String">javax.jms.Topic</config-property>
          <config-property name="JmsProviderAdapterJNDI" type="java.lang.String">java:/DefaultJMSProvider</config-property>
          <config-property name="ConnectorClassName" type="java.lang.String">org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property>
          <config-property name="ConnectionParameters" type="java.lang.String">host=[live_server_IP_address];port=[live_server_port_number]</config-property>
          <max-pool-size>20</max-pool-size>
          <security-domain-and-application>JmsXARealm</security-domain-and-application>
       </tx-connection-factory>
    </connection-factories>
    
    Copy to Clipboard Toggle word wrap
  5. Open $JBOSS_HOME/server/EAP2/deploy/jms-ra.rar/META-INF/ra.xml in a text editor.
  6. In ra.xml, search for <resourceadapter>.
  7. Configure the Inbound Connector

    Replace the "The transport type" and "The transport configuration..." <config-property> elements, and their child elements with the following configuration:

    Important

    Substitute the [live_server_IP_address] and [live_server_port_number] with the network address locations for your live server.
    If you are using Discovery to set IP address/port combinations, ensure you set the appropriate parameters for <DiscoveryAddress> and <DiscoveryPort> to match your configured broadcast groups.
    If you are using Auto Discovery, ensure you comment out ConnectorClassName and ConnectionParameters directives.
    <?xml version="1.0" encoding="UTF-8"?>
    
    <!-- Preceeding parts of config file removed for readability -->
    
    <resourceadapter>
       <resourceadapter-class>org.hornetq.ra.HornetQResourceAdapter</resourceadapter-class>
       <config-property>
          <description>The transport type</description>
          <config-property-name>ConnectorClassName</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>org.hornetq.core.remoting.impl.netty.NettyConnectorFactory</config-property-value>
       </config-property>
       <config-property>
          <description>The transport configuration. These values must be in the form of key=val;key=val;</description>
          <config-property-name>ConnectionParameters</config-property-name>
          <config-property-type>java.lang.String</config-property-type>
          <config-property-value>host=[live_server_IP_address];port=[live_server_port_number]</config-property-value>
       </config-property>
       <config-property>
          <description>Do we support HA</description>
          <config-property-name>HA</config-property-name>
          <config-property-type>java.lang.Boolean</config-property-type>
          <config-property-value>true</config-property-value>
       </config-property>
    
    <!-- Rest of config file removed for readability -->
    
    <resourceadapter>
    
    Copy to Clipboard Toggle word wrap
Volver arriba
Red Hat logoGithubredditYoutubeTwitter

Aprender

Pruebe, compre y venda

Comunidades

Acerca de la documentación de Red Hat

Ayudamos a los usuarios de Red Hat a innovar y alcanzar sus objetivos con nuestros productos y servicios con contenido en el que pueden confiar. Explore nuestras recientes actualizaciones.

Hacer que el código abierto sea más inclusivo

Red Hat se compromete a reemplazar el lenguaje problemático en nuestro código, documentación y propiedades web. Para más detalles, consulte el Blog de Red Hat.

Acerca de Red Hat

Ofrecemos soluciones reforzadas que facilitan a las empresas trabajar en plataformas y entornos, desde el centro de datos central hasta el perímetro de la red.

Theme

© 2025 Red Hat