在使用Jboss资源适配器连接ActiveMQ时配置sendTimeout
基于此,我已将JBoss eap 6.2连接到外部在使用Jboss资源适配器连接ActiveMQ时配置sendTimeout,jboss,jms,activemq,jboss6.x,Jboss,Jms,Activemq,Jboss6.x,基于此,我已将JBoss eap 6.2连接到外部ActiveMQ 5.9.0。org.apache.activemq.ActiveMQConnectionFactory有一个我要设置的sendTimeout字段。但是在这种方法中,我不能直接访问这个类,似乎我所能做的就是在JBoss的resourceAdapter中standalone.xml的ServerUrl中添加一些参数 基于此,可以向ServerUrl添加一些参数,但它似乎没有sendTimeout参数。这个(ActiveMQ CPP)
ActiveMQ 5.9.0
。org.apache.activemq.ActiveMQConnectionFactory
有一个我要设置的sendTimeout
字段。但是在这种方法中,我不能直接访问这个类,似乎我所能做的就是在JBoss的resourceAdapter
中standalone.xml
的ServerUrl
中添加一些参数
基于此,可以向ServerUrl
添加一些参数,但它似乎没有sendTimeout
参数。这个(ActiveMQ CPP)引入了一些其他参数,它们不起作用,我在Jboss启动时遇到以下错误:
java.lang.IllegalArgumentException: Invalid connect parameters: {connection.sendTimeout=20000}
standalone.xml
文件中的ActiveMQ资源适配器
:
<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>
本地事务
tcp://localhost:61616?connection.sendTimeout=20000
那个么我如何设置这个参数的值呢?我是否应该改为在ra.xml
文件中配置ServerUrl
?基于故障转移传输选项的timeout
参数:
如果发送被阻止,请等待失败的连接重新连接
如果在发送失败之前等待很长时间,默认值为永久(-1)
因此,我将resourceadapter
和ra.xml
的ServerUrl
属性更改为:
故障转移://(tcp://127.0.0.1:61616)?超时=20000