`

ActiveMQ持久化MySql配置

    博客分类:
  • MQ
 
阅读更多
apache-activemq-5.11.1-bin.zip

activemq.xml文件配置:
<!-- START SNIPPET: example -->
<beans
  xmlns="http://www.springframework.org/schema/beans"
  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.xsd
  http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">

    <!-- Allows us to use system properties as variables in this configuration file -->
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.conf}/credentials.properties</value>
        </property>
    </bean>

   <!-- Allows accessing the server log -->
    <bean id="logQuery" class="io.fabric8.insight.log.log4j.Log4jLogQuery"
          lazy-init="false" scope="singleton"
          init-method="start" destroy-method="stop">
    </bean>

    <!--
        The <broker> element is used to configure the ActiveMQ broker.
    -->
    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">

        <destinationPolicy>
            <policyMap>
              <policyEntries>
                <policyEntry topic=">" >
                    <!-- The constantPendingMessageLimitStrategy is used to prevent
                         slow topic consumers to block producers and affect other consumers
                         by limiting the number of messages that are retained
                         For more information, see:

                         http://activemq.apache.org/slow-consumer-handling.html

                    -->
                  <pendingMessageLimitStrategy>
                    <constantPendingMessageLimitStrategy limit="1000"/>
                  </pendingMessageLimitStrategy>
                </policyEntry>
              </policyEntries>
            </policyMap>
        </destinationPolicy>


        <!--
            The managementContext is used to configure how ActiveMQ is exposed in
            JMX. By default, ActiveMQ uses the MBean server that is started by
            the JVM. For more information, see:

            http://activemq.apache.org/jmx.html
        -->
        <managementContext>
            <managementContext createConnector="false"/>
        </managementContext>

        <!--
            Configure message persistence for the broker. The default persistence
            mechanism is the KahaDB store (identified by the kahaDB tag).
            For more information, see:

            http://activemq.apache.org/persistence.html
			        <persistenceAdapter>
            <kahaDB directory="${activemq.data}/kahadb"/>
        </persistenceAdapter>
        -->

		<persistenceAdapter>  
            <jdbcPersistenceAdapter  dataDirectory="${activemq.base}/data" dataSource="#mysql-ds" useDatabaseLock="false"/>   
        </persistenceAdapter> 

          <!--
            The systemUsage controls the maximum amount of space the broker will
            use before disabling caching and/or slowing down producers. For more information, see:
            http://activemq.apache.org/producer-flow-control.html
          -->
          <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70" />
                </memoryUsage>
                <storeUsage>
                    <storeUsage limit="100 gb"/>
                </storeUsage>
                <tempUsage>
                    <tempUsage limit="50 gb"/>
                </tempUsage>
            </systemUsage>
        </systemUsage>

        <!--
            The transport connectors expose ActiveMQ over a given protocol to
            clients and other brokers. For more information, see:

            http://activemq.apache.org/configuring-transports.html
        -->
        <transportConnectors>
            <!-- DOS protection, limit concurrent connections to 1000 and frame size to 100MB -->
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&amp;wireFormat.maxFrameSize=104857600"/>
        </transportConnectors>

        <!-- destroy the spring context on shutdown to stop jetty -->
        <shutdownHooks>
            <bean xmlns="http://www.springframework.org/schema/beans" class="org.apache.activemq.hooks.SpringContextHook" />
        </shutdownHooks>

    </broker>

	<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">  
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>   
        <property name="url" value="jdbc:mysql://localhost:3306/activemq?relaxAutoCommit=true"/>  
        <property name="username" value="root"/>  
        <property name="password" value="123456"/>   
        <property name="poolPreparedStatements" value="true"/>   
    </bean>   
	
    <!--
        Enable web consoles, REST and Ajax APIs and demos
        The web consoles requires by default login, you can disable this in the jetty.xml file

        Take a look at ${ACTIVEMQ_HOME}/conf/jetty.xml for more details
    -->
    <import resource="jetty.xml"/>

</beans>
<!-- END SNIPPET: example -->





  • 大小: 111.2 KB
  • 大小: 59.3 KB
分享到:
评论

相关推荐

    ActiveMQ配置Mysql8为持久化方式所需Jar包.rar

    ActiveMQ配置Mysql8为持久化方式所需Jar包

    activemq-5.15.15 JDBC持久化mysql8.0+的activemq.xml.pdf

    activemq-5.15.15 JDBC持久化mysql8.0+的activemq.xml

    activeMQ mysql 持久化

    NULL 博文链接:https://showlike.iteye.com/blog/2000117

    spring集成activemq演示queue和topic 持久化

    本人在学习activemq,然后 测试完成的demo, 包含了queue,topic,持久化到mysql,订阅模式,包好用

    activemq.xml

    ActiveMQ整合MySql实现消息持久化配置文件

    activeMQ使用JDBC所需要的jar包

    使用activeMQ进行持久化时,所需要的相关jar包,mysql驱动、连接池等jar包

    activemq配置jdbc所需jar.rar

    ActiveMQ整合MySQL实现消息持久化所需jar包 aspectjrt-1.9.2.jar commons-collections-3.1.jar commons-dbcp-1.2.1.jar commons-dbcp2-2.5.0.jar commons-pool-1.2.jar commons-pool2-2.5.0.jar mysql-connector-...

    消息队列中间件ActiveMQ入门到精通视频教程及资料

    003-顺序消费+消息过滤SELECTOR+MessageConsumer+MySql持久化;004-p2p模式+pulish-subscribe发布订阅模式+与spring集成;005-集群部署1;006-集群部署2;007-集群部署3;activemq集群配置文档.pdf;ActiveMQ(中文)...

    ActiveMQ从入门到精通(二)

    本文来自于jianshu,介绍了消息的顺序消费、JMSSelectors、消息的同步/异步接受方式、Message、P2P/PubSub、持久化订阅、持久化消息到MySQL以及与Spring整合等知识。接上一篇,本篇主要讨论的话题是:消息的顺序消费...

    Java面试八股文.zip

    2.3 Redis持久化机制 2.4 Redis高级特性和集群 3. MySQL数据库篇 3.1 MySQL简介和基本操作 3.2 数据库设计范式和优化 3.3 事务和并发控制 3.4 索引和优化技巧 4. 框架篇 4.1 Spring框架概述 4.2 Spring...

    springcloud入门

    springcloud-zipkin:链路跟踪工具,监控并就持久化微服务集群中调用链路的通畅情况,采用rabbitmq异步传输、elasticsearch负责持久化的方式集成。 #### 软件架构 1、JDK:jdk-8u181-windows-x64。 2、MAVEN:...

    Java思维导图xmind文件+导出图片

    图解Redis中的AOF和RDB持久化策略的原理 redis读写分离架构实践 redis哨兵架构及数据丢失问题分析 redis Cluster数据分布算法之Hash slot redis使用常见问题及性能优化思路 redis高可用及高并发实战 缓存击穿...

    transactions-dubbo:dubbo项目基于atomikos的分布式事务管理

    transactions-dubbo dubbo项目基于atomikos的分布式事务管理 框架介绍 ...​ 项目现在有很多不足,微服务框架只支持dubbo,数据库持久化框架只支持mybatis,只支持管理数据库事务、activemq的事务、rock

    大型分布式网站架构与实践

     2.2 持久化存储 71  2.2.1 MySQL扩展 72  2.2.2 HBase 80  2.2.3 Redis 91  2.3 消息系统 95  2.3.1 ActiveMQ & JMS 96  2.4 垂直化搜索引擎 104  2.4.1 Lucene简介 105  2.4.2 Lucene的使用 108  2.4.3 ...

    java面试题,180多页,绝对良心制作,欢迎点评,涵盖各种知识点,排版优美,阅读舒心

    【消息队列】持久化消息非常慢 162 【消息队列】消息的不均匀消费 162 【消息队列】ActiveMQ中的消息重发时间间隔和重发次数吗? 164 【Dubbo】dubbo介绍 166 Dubbo 是什么 166 Dubbo 架构流程图 167 调用流程 167 ...

    【白雪红叶】JAVA学习技术栈梳理思维导图.xmind

    ActiveMQ 常用开源框架 Spring Spring MVC Spring WebFlow spring tx aop ioc Struts ibatis Mybatis CAS Dubbo 工作能力 软实力 应急能力 创新能力 管理能力 分享能力 学习能力 沟通能力 ...

    JAVA上百实例源码以及开源项目

     关于数字签名:产生RSA密钥对(myKeyPair),得到RSA密钥对,产生Signature对象,对用私钥对信息(info)签名,用指定算法产生签名对象,用私钥初始化签名对象,将待签名的数据传送给签名对象(须在初始化之后),用公钥...

    JAVA上百实例源码以及开源项目源代码

     关于数字签名:产生RSA密钥对(myKeyPair),得到RSA密钥对,产生Signature对象,对用私钥对信息(info)签名,用指定算法产生签名对象,用私钥初始化签名对象,将待签名的数据传送给签名对象(须在初始化之后),用公钥...

Global site tag (gtag.js) - Google Analytics