A​c​t​i​v​e​M​Q​ 5.10.0 配​置SQL Server2012数据库

1、下载 Microsoft_JDBC_Driver_4.0_for_SQL_Server ,将 sqljdbc4.jar 放到ActiveMQ的lib\optional目录下,如 D:\apache-activemq-5.10.0\lib\optional

2、修改 D:\apache-activemq-5.10.0\conf\activemq.xml



<persistenceAdapter>
<kahaDB directory="${activemq.data}/kahadb"/>
</persistenceAdapter>

修改为:


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

增加下面这段,和 </broker> 同级。


<bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
<property name="url" value="jdbc:sqlserver://192.168.1.182:1433;DatabaseName=ActiveMQDB"/>
<property name="username" value="sa"/>
<property name="password" value="Sa!11111"/>
</bean>


成功后会在数据库创建3张表 ACTIVEMQ_ACKS,ACTIVEMQ_LOCK,ACTIVEMQ_MSGS

参考文章: http://activemq.apache.org/sqlserver.html


成功日志如下:


D:\apache-activemq-5.10.0\bin\win64>activemq.bat
wrapper | --> Wrapper Started as Console
wrapper | Launching a JVM...
jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
jvm 1 |
jvm 1 | Java Runtime: Sun Microsystems Inc. 1.6.0_43 D:\Java\jre6
jvm 1 | Heap sizes: current=123712k free=116584k max=932096k
jvm 1 | JVM args: -Dactivemq.home=../.. -Dactivemq.base=../.. -Djavax.net.ssl.keyStorePasswor
d=password -Djavax.net.ssl.trustStorePassword=password -Djavax.net.ssl.keyStore=../../conf/broker.ks
-Djavax.net.ssl.trustStore=../../conf/broker.ts -Dcom.sun.management.jmxremote -Dorg.apache.activem
q.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dactivemq.conf=../
../conf -Dactivemq.data=../../data -Djava.security.auth.login.config=../../conf/login.config -Xmx102
4m -Djava.library.path=../../bin/win64 -Dwrapper.key=DeK4zSpKsQCJZV1o -Dwrapper.port=32000 -Dwrapper
.jvm.port.min=31000 -Dwrapper.jvm.port.max=31999 -Dwrapper.pid=9308 -Dwrapper.version=3.2.3 -Dwrappe
r.native_library=wrapper -Dwrapper.cpu.timeout=10 -Dwrapper.jvmid=1
jvm 1 | Extensions classpath:
jvm 1 | [..\..\lib,..\..\lib\camel,..\..\lib\optional,..\..\lib\web,..\..\lib\extra]
jvm 1 | ACTIVEMQ_HOME: ..\..
jvm 1 | ACTIVEMQ_BASE: ..\..
jvm 1 | ACTIVEMQ_CONF: ..\..\conf
jvm 1 | ACTIVEMQ_DATA: ..\..\data
jvm 1 | Loading message broker from: xbean:activemq.xml
jvm 1 | INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@6e84cc09: startup date
[Tue Jul 29 15:57:33 GMT+08:00 2014]; root of context hierarchy
jvm 1 | INFO | PListStore:[D:\apache-activemq-5.10.0\bin\win64\..\..\data\localhost\tmp_storage]
started
jvm 1 | INFO | Using Persistence Adapter: JDBCPersistenceAdapter(org.apache.commons.dbcp.BasicDa
taSource@444b0bbb)
jvm 1 | INFO | Database adapter driver override recognized for : [microsoft_jdbc_driver_4_0_for_
sql_server] - adapter: class org.apache.activemq.store.jdbc.adapter.TransactJDBCAdapter
jvm 1 | INFO | Database lock driver override recognized for : [microsoft_jdbc_driver_4_0_for_sql
_server] - adapter: class org.apache.activemq.store.jdbc.adapter.TransactDatabaseLocker
jvm 1 | INFO | Using a separate dataSource for locking: org.apache.commons.dbcp.BasicDataSource@
444b0bbb
jvm 1 | INFO | Attempting to acquire the exclusive lock to become the Master broker
jvm 1 | INFO | Becoming the master on dataSource: org.apache.commons.dbcp.BasicDataSource@444b0b
bb
jvm 1 | INFO | Apache ActiveMQ 5.10.0 (localhost, ID:hanhj-56705-1406620654948-0:1) is starting
jvm 1 | INFO | Listening for connections at: tcp://hanhj:61616?maximumConnections=1000&wireForma
t.maxFrameSize=104857600
jvm 1 | INFO | Connector openwire started
jvm 1 | INFO | Listening for connections at: amqp://hanhj:5672?maximumConnections=1000&wireForma
t.maxFrameSize=104857600
jvm 1 | INFO | Connector amqp started
jvm 1 | INFO | Listening for connections at: stomp://hanhj:61613?maximumConnections=1000&wireFor
mat.maxFrameSize=104857600
jvm 1 | INFO | Connector stomp started
jvm 1 | INFO | Listening for connections at: mqtt://hanhj:1883?maximumConnections=1000&wireForma
t.maxFrameSize=104857600
jvm 1 | INFO | Connector mqtt started
jvm 1 | INFO | Listening for connections at ws://hanhj:61614?maximumConnections=1000&wireFormat.
maxFrameSize=104857600
jvm 1 | INFO | Connector ws started
jvm 1 | INFO | Apache ActiveMQ 5.10.0 (localhost, ID:hanhj-56705-1406620654948-0:1) started
jvm 1 | INFO | For help or more information please see: http://activemq.apache.org
jvm 1 | INFO | ActiveMQ WebConsole available at http://0.0.0.0:8161/
jvm 1 | INFO | Initializing Spring FrameworkServlet 'dispatcher'
jvm 1 | INFO | jolokia-agent: No access restrictor found at classpath:/jolokia-access.xml, acces
s to all MBeans is allowed
jvm 1 | INFO | Connector vm://localhost started
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值