0 Replies Latest reply on Jun 23, 2010 9:16 PM by Luke McLean

    HornetQ + Spring: Embedded in Mule ESB, Clustering, no UDP

    Luke McLean Newbie

      Hello,

       

      I've embedded HornetQ into Mule (using Spring). The added complication I have is that our environment does not support Multicast UDP between network zones. I must therefore use static transportConfigurations. Could someone take a peek at this and check that I've done this the correct way. transportConfiguration0 points to localhost and transportConfirguration1 points to another server. It appears to be working but I'm dubious about the connectionFactory bean wiring... is that what you would expect or is there a simpler method?

       

      Thanks,

      Luke.

       

       

       

       

      <bean name="namingServerImpl" init-method="start" destroy-method="stop" />
           
          <bean name="namingServer" init-method="start" destroy-method="stop">
               <property name="namingInfo" ref="namingServerImpl" />
                <property name="port" value="1099"/>
                <property name="bindAddress" value="localhost"/>
                <property name="rmiPort" value="1098"/>
                <property name="rmiBindAddress" value="localhost"/>
          </bean>
              
          <bean name="mbeanServer" factory-method="getPlatformMBeanServer" />
           
          <bean name="fileConfiguration" init-method="start" destroy-method="stop" />
           
          <bean name="hornetQSecurityManagerImpl" />
           
          <!-- The core server -->
          <bean name="hornetQServerImpl">
               <constructor-arg ref="fileConfiguration" />
               <constructor-arg ref="mbeanServer" />
               <constructor-arg ref="hornetQSecurityManagerImpl" />
          </bean>
           
          <!-- The JMS server -->
          <bean name="jmsServerManagerImpl" 
              init-method="start" destroy-method="stop" depends-on="namingServer">
               <constructor-arg ref="hornetQServerImpl" />
          </bean>
        
          <bean name="transportConfiguration0">
              <constructor-arg index="0" value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"/>       
              <constructor-arg index="1"> 
                  <util:map id="jmsProperties0" map-class="java.util.Hashtable"> 
                      <entry key="host" value="${hornetq.host}"/>
                      <entry key="port" value="${hornetq.port}"/>
                  </util:map> 
              </constructor-arg> 
             </bean>
             
             <bean name="transportConfiguration1">
              <constructor-arg index="0" value="org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"/>       
              <constructor-arg index="1"> 
                  <util:map id="jmsProperties1" map-class="java.util.Hashtable"> 
                      <entry key="host" value="${hornetq.host1}"/>
                      <entry key="port" value="${hornetq.port}"/>
                  </util:map> 
              </constructor-arg> 
             </bean>
           
        
           <bean name="connectionFactory">  
              <constructor-arg>
                  <list>
                  <bean class="org.hornetq.api.core.Pair">
                      <constructor-arg index="0">
                          <ref bean="transportConfiguration0"/>
                      </constructor-arg>
                      <constructor-arg index="1"><null/></constructor-arg>
                  </bean>
                  <bean class="org.hornetq.api.core.Pair">
                      <constructor-arg index="0">
                          <ref bean="transportConfiguration1"/>
                      </constructor-arg>
                      <constructor-arg index="1"><null/></constructor-arg>
                  </bean>
                  </list>
              </constructor-arg> 
              
              <property name="minLargeMessageSize" value="50000"/>
              <property name="cacheLargeMessagesClient" value="false"/>
              <!-- 
              <property name="discoveryAddress" value="${hornetq.broadcast.address}"/>  
              <property name="discoveryPort" value="9876"/>
              -->
          </bean>