此内容没有您所选择的语言版本。

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

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。 了解我们当前的更新.

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

Theme

© 2025 Red Hat