activemq持久化配置,设置为主从模式(带复制的主从模式,应用mysql数据库)

配置文件如下


xmlns="http://www.springframework.org/schema/beans"
xmlns:amq="http://activemq.apache.org/schema/core"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd   
http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">

   
   
        
            file:///${activemq.base}/conf/credentials.properties
        
      
   


    


    
       
       
           
               
                   
                   
                     
                   

               

           

       


       
       
           
       


       
  
           
  
           
         

   

 
     

           
       


       
       

       



       

       
           
       

        
       
       
           
               
                   
               

               
                   
               

               
                   
               

           

       



       
       
            discoveryUri="multicast://default"/>
           
           
           
       


   

   
   

       
        org.foo.bar

       
       
           
           
       

   


   

   
    

       
         
           
           
           
         

       
   



   
   


   
   
       
           
       


       
           
           
           
       

   


   

   
   

   
    
    

     
     
     
     
     
     
   

    

   
   

   
   




已主从模式运行(192.168.2.137为主,192.168.2.136为从),还需在客户端上运行如下命令:
java.naming.provider.url=failover:(tcp://192.168.2.137:61616,tcp://192.168.2.136:61616)?
randomize=false                          #没有这一行的话,就变成了networks of brokers
initialReconnectDelay=10            #这里的单位是毫秒




activemq的目录里有个example,只要简单配置一下build.xml,即可测试activemq的message的consume和query


   
   

   
   


你可能感兴趣的:(ActiveMQ)