이 콘텐츠는 선택한 언어로 제공되지 않습니다.

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
맨 위로 이동
Red Hat logoGithubredditYoutubeTwitter

자세한 정보

평가판, 구매 및 판매

커뮤니티

Red Hat 문서 정보

Red Hat을 사용하는 고객은 신뢰할 수 있는 콘텐츠가 포함된 제품과 서비스를 통해 혁신하고 목표를 달성할 수 있습니다. 최신 업데이트를 확인하세요.

보다 포괄적 수용을 위한 오픈 소스 용어 교체

Red Hat은 코드, 문서, 웹 속성에서 문제가 있는 언어를 교체하기 위해 최선을 다하고 있습니다. 자세한 내용은 다음을 참조하세요.Red Hat 블로그.

Red Hat 소개

Red Hat은 기업이 핵심 데이터 센터에서 네트워크 에지에 이르기까지 플랫폼과 환경 전반에서 더 쉽게 작업할 수 있도록 강화된 솔루션을 제공합니다.

Theme

© 2025 Red Hat