activemq的jdbc配置

如果按照我下面的配置还不行的话,可能是你的数据库没有访问权限,看下面这个连接解决。
https://blog.csdn.net/h985161183/article/details/82218710
没有mysql包的同学可以根据下面这个连接下载,想搞点币哈,谢谢大家理解
https://download.csdn.net/download/weixin_45059888/12493371
如果jar包下载地址有误的话,请留言哈



<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">

    
    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
        <property name="locations">
            <value>file:${activemq.conf}/credentials.propertiesvalue>
        property>
    bean>

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

    
    <broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">

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


        
        <managementContext>
            <managementContext createConnector="false"/>
        managementContext>

        



        <persistenceAdapter>
            <jdbcPersistenceAdapter dataSource="#mysql-ds"/>
        persistenceAdapter>

          
          <systemUsage>
            <systemUsage>
                <memoryUsage>
                    <memoryUsage percentOfJvmHeap="70" />
                memoryUsage>
                <storeUsage>
                    <storeUsage limit="100 gb"/>
                storeUsage>
                <tempUsage>
                    <tempUsage limit="50 gb"/>
                tempUsage>
            systemUsage>
        systemUsage>

        
        <transportConnectors>
            
            <transportConnector name="openwire" uri="tcp://0.0.0.0:61616?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="amqp" uri="amqp://0.0.0.0:5672?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="stomp" uri="stomp://0.0.0.0:61613?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="mqtt" uri="mqtt://0.0.0.0:1883?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
            <transportConnector name="ws" uri="ws://0.0.0.0:61614?maximumConnections=1000&wireFormat.maxFrameSize=104857600"/>
        transportConnectors>

        
        <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.dbcp2.BasicDataSource" destroy-method="close">
        <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
        <property name="url" value="jdbc:mysql://你自己的地址:3306/activemq?relaxAutoCommit=true"/>
        <property name="username" value="root"/>
        <property name="password" value="123456"/>
        <property name="maxTotal" value="200"/>
        <property name="poolPreparedStatements" value="true"/>
    bean>
    
    <import resource="jetty.xml"/>

beans>

你可能感兴趣的:(问题解决,activemq)