You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Matthew Xie <an...@163.com> on 2006/08/07 08:46:59 UTC

dose failover have a timeout setting?

I use spring JmsTemplate to send jms message to AcitveMQ server. but i found
a problem that if amq server is not avaible, it will throw exception while
reconnect timeout.

here's my spring xml configurations:
  <bean id="jmsFactory"
class="org.apache.activemq.pool.PooledConnectionFactory">
	<property name="connectionFactory">
		<bean class="org.apache.activemq.ActiveMQConnectionFactory"> <!--
;jms.useAsyncSend=true -->
			<property name="brokerURL"
value="failover:(tcp://ip1:61616,tcp://ip2:61616)?randomize=false;initialReconnectDelay=100;maxReconnectAttempts=2;maxReconnectDelay=1000;soTimeout=1000"/>
		</bean>
	</property>
  </bean>

  <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
	<property name="connectionFactory">
		<ref local="jmsFactory"/>
	</property>
  </bean> 

is there any mistakes ?
could someone do me a favor? Thx!

Matt.
-- 
View this message in context: http://www.nabble.com/dose-failover-have-a-timeout-setting--tf2061946.html#a5680259
Sent from the ActiveMQ - User forum at Nabble.com.


Re: dose failover have a timeout setting?

Posted by James Strachan <ja...@gmail.com>.
The configuration you are using will only try 2 times to reconnect -
then it will fail with an exception.

If you want it to spend longer reconnecting consider increasing the value of

maxReconnectAttempts=2


On 8/7/06, Matthew Xie <an...@163.com> wrote:
>
> I use spring JmsTemplate to send jms message to AcitveMQ server. but i found
> a problem that if amq server is not avaible, it will throw exception while
> reconnect timeout.
>
> here's my spring xml configurations:
>   <bean id="jmsFactory"
> class="org.apache.activemq.pool.PooledConnectionFactory">
>         <property name="connectionFactory">
>                 <bean class="org.apache.activemq.ActiveMQConnectionFactory"> <!--
> ;jms.useAsyncSend=true -->
>                         <property name="brokerURL"
> value="failover:(tcp://ip1:61616,tcp://ip2:61616)?randomize=false;initialReconnectDelay=100;maxReconnectAttempts=2;maxReconnectDelay=1000;soTimeout=1000"/>
>                 </bean>
>         </property>
>   </bean>
>
>   <bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
>         <property name="connectionFactory">
>                 <ref local="jmsFactory"/>
>         </property>
>   </bean>
>
> is there any mistakes ?
> could someone do me a favor? Thx!
>
> Matt.
> --
> View this message in context: http://www.nabble.com/dose-failover-have-a-timeout-setting--tf2061946.html#a5680259
> Sent from the ActiveMQ - User forum at Nabble.com.
>
>


-- 

James
-------
http://radio.weblogs.com/0112098/