gpt4 book ai didi

mysql - 使用日志式 MySQL JDBC 持久性设置 ActiveMQ

转载 作者:行者123 更新时间:2023-11-29 01:45:14 25 4
gpt4 key购买 nike

我正在运行 ActiveMQ 5.5.1,但在配置日志 JDBC 持久性时遇到问题。使用the example here ,我收到以下 XML 验证错误:

./activemq console xbean:my-activemq.xml

Java Runtime: Sun Microsystems Inc. 1.6.0_29 /home/aj/jdk1.6.0_29/jre
Heap sizes: current=253440k free=250641k max=253440k
JVM args: -Xms256M -Xmx256M -Dorg.apache.activemq.UseDedicatedTaskRunner=true -Djava.util.logging.config.file=logging.properties -Dcom.sun.management.jmxremote -Dactivemq.classpath=/home/aj/apache-activemq-5.5.1/conf; -Dactivemq.home=/home/aj/apache-activemq-5.5.1 -Dactivemq.base=/home/aj/apache-activemq-5.5.1
ACTIVEMQ_HOME: /home/aj/apache-activemq-5.5.1
ACTIVEMQ_BASE: /home/aj/apache-activemq-5.5.1
Loading message broker from: xbean:my-activemq.xml

INFO | Refreshing org.apache.activemq.xbean.XBeanBrokerFactory$1@13f3045: startup date [Thu Dec 22 07:49:17 EST 2011]; root of context hierarchy
ERROR: java.lang.RuntimeException: Failed to execute start task.
Reason: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class path resource [my-activemq.xml]:
Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException:
Failed to convert property value of type
'org.apache.activemq.store.journal.JournalPersistenceAdapter' to required type
'org.apache.activemq.store.PersistenceAdapterFactory' for property 'persistenceFactory';
nested exception is java.lang.IllegalStateException: Cannot convert value of type
[org.apache.activemq.store.journal.JournalPersistenceAdapter] to required type
[org.apache.activemq.store.PersistenceAdapterFactory] for property 'persistenceFactory': no matching editors or conversion strategy found

我已经查看了 the published schema , 但它似乎与此示例完全不同,因此很明显两个来源之一不同步。任何人都可以使用 Journaled JDBC 和 MySQL 分享他们的工作持久性配置吗?

这是我配置的相关部分:

<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/activemq?relaxAutoCommit=true"/>
<property name="username" value="activemq"/>
<property name="password" value="activemq"/>
<property name="maxActive" value="200"/>
<property name="poolPreparedStatements" value="true"/>
</bean>

<persistenceFactory>
<journaledJDBC journalLogFiles="5" dataDirectory="${activemq.base}/activemq-data" dataSource="#mysql-ds"/>
</persistenceFactory>

最佳答案

您可以尝试使用以下配置设置您的持久化适配器:

<persistenceFactory>
<journalPersistenceAdapterFactory journalLogFiles="5" dataDirectory="${activemq.base}/data" dataSource="#mysql-ds">
</journalPersistenceAdapterFactory>
</persistenceFactory>

它对我有用,但如果您打算使用故障转移,请注意日志的缺点 - 它们根本无法协同工作(从属代理上没有您的日志副本)。经过考虑,我们决定使用不带日志记录的 sql server 持久性,它对发布者和订阅者的故障转移都工作得很好。

关于mysql - 使用日志式 MySQL JDBC 持久性设置 ActiveMQ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8604229/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com