基于这个链接,我已经将JBoss eap 6.2连接到一个外部ActiveMQ 5.9.0。org.apache.activemq.ActiveMQConnectionFactory有一个我想设置的sendTimeout字段。但是在这种方法中,我不能直接访问这个类,似乎我所能做的就是在ServerUrl中添加一些参数,比如resouce-adapter中的参数、standalone.xml中的减速以及JBoss中的减速。
基于这个链接,可以向ServerUrl添加一些参数,但似乎没有sendTimeout参数。这个链接 (ActiveMQ CPP)引入了一些其他参数,这些参数不起作用,在Jboss启动时,我得到了以下错误:
java.lang.IllegalArgumentException: Invalid connect parameters: {connection.sendTimeout=20000}ActiveMQ resource-adapter in standalone.xml文件:
<subsystem xmlns="urn:jboss:domain:resource-adapters:1.1">
<resource-adapters>
<resource-adapter id="activemq-rar.ra">
<module slot="main" id="org.apache.activemq"/>
<transaction-support>LocalTransaction</transaction-support>
<config-property name="ServerUrl">tcp://localhost:61616?connection.sendTimeout=20000</config-property>
<connection-definitions>
<connection-definition class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory" jndi-name="java:/activemq/ConnectionFactory" enabled="true" use-java-context="true" pool-name="ActiveMQConnectionFactoryPool">
</connection-definition>
</connection-definitions>
</resource-adapter>
<!--resource-adapter-->
</resource-adapters>
</subsystem>那么如何设置这个参数的值呢?我是否应该在ServerUrl文件中配置ra.xml?
发布于 2015-01-31 11:12:17
基于此配置页的Failover Transport Options的timeout参数
如果一个发送被阻塞,等待一个失败的连接重新连接它应该等待多长时间才能失败发送,默认是永远(-1)。
因此,我将ServerUrl属性resource-adapter和ra.xml更改为:
failover://(tcp://127.0.0.1:61616)?timeout=20000
https://stackoverflow.com/questions/28223489
复制相似问题