<bean id="hana-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName" value="com.sap.db.jdbc.Driver"/> <property name="url" value="jdbc:sap://192.168.23.144:30015"/> <property name="username" value="WIP"/> <property name="password" value="Aa123456"/> </bean>
修改默認的kahadb配置sql
<persistenceAdapter> <kahaDB directory="${activemq.data}/kahadb"/> </persistenceAdapter>
改成數據庫
<persistenceAdapter> <jdbcPersistenceAdapter dataSource="#hana-ds"/> </persistenceAdapter>
CREATE TABLE ACTIVEMQ_ACKS ( CONTAINER VARCHAR(250) NOT NULL, SUB_DEST VARCHAR(250), CLIENT_ID VARCHAR(250) NOT NULL, SUB_NAME VARCHAR(250) NOT NULL, SELECTOR VARCHAR(250), LAST_ACKED_ID BIGINT, PRIORITY BIGINT NOT NULL DEFAULT 5, XID VARCHAR(250) ) ; CREATE TABLE ACTIVEMQ_LOCK ( ID BIGINT NOT NULL, TIME BIGINT, BROKER_NAME VARCHAR(250), CONSTRAINT "_SYS_TREE_RS_#186984_#0_#P0" PRIMARY KEY (ID) ) ; CREATE TABLE ACTIVEMQ_MSGS ( ID BIGINT NOT NULL, CONTAINER VARCHAR(250), MSGID_PROD VARCHAR(250), MSGID_SEQ BIGINT, EXPIRATION BIGINT, MSG BLOB, PRIORITY BIGINT NOT NULL DEFAULT 5, XID VARCHAR(250) ) ; CREATE INDEX ACTIVEMQ_MSGS_CIDX ON WIP.ACTIVEMQ_MSGS (CONTAINER) ; CREATE INDEX ACTIVEMQ_MSGS_EIDX ON WIP.ACTIVEMQ_MSGS (EXPIRATION) ; CREATE INDEX ACTIVEMQ_MSGS_MIDX ON WIP.ACTIVEMQ_MSGS (MSGID_PROD,MSGID_SEQ) ; CREATE INDEX ACTIVEMQ_MSGS_PIDX ON WIP.ACTIVEMQ_MSGS (PRIORITY) ; CREATE INDEX ACTIVEMQ_MSGS_XIDX ON WIP.ACTIVEMQ_MSGS (XID) ;
從新啓動mq,啓動成功,測試也OK!apache