You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by cafe <rm...@estudiantes.uci.cu> on 2007/02/06 19:40:41 UTC

Problems reconnecting when the broker break down

In my app I’m using activeMQ4.1.0 and spring 2.0. and I have configured a
DefaultMessageListenerContainer and a PooledConnectionFactory.


And doing some test if I restart my broker the app is not capable of
reconnect and I get the following exception:


org.springframework.jms.listener.DefaultMessageListenerContainer
handleListenerSetupFailure
SEVERE: Setup of JMS message listener invoker failed - trying to recover
org.apache.activemq.ConnectionFailedException: The JMS connection has
failed: java.io.EOFException
	at
org.apache.activemq.ActiveMQConnection.checkClosedOrFailed(ActiveMQConnection.java:1230)
	at
org.apache.activemq.ActiveMQConnection.createSession(ActiveMQConnection.java:273)
	at org.apache.activemq.pool.SessionPool.createSession(SessionPool.java:113)
	at org.apache.activemq.pool.SessionPool.makeObject(SessionPool.java:81)
	at
org.apache.commons.pool.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:840)
	at org.apache.activemq.pool.SessionPool.borrowSession(SessionPool.java:56)
	at
org.apache.activemq.pool.ConnectionPool.createSession(ConnectionPool.java:71)
	at
org.apache.activemq.pool.PooledConnection.createSession(PooledConnection.java:130)
	at
org.springframework.jms.listener.AbstractMessageListenerContainer.createSession(AbstractMessageListenerContainer.java:1000)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.initResourcesIfNecessary(DefaultMessageListenerContainer.java:882)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.invokeListener(DefaultMessageListenerContainer.java:870)
	at
org.springframework.jms.listener.DefaultMessageListenerContainer$AsyncMessageListenerInvoker.run(DefaultMessageListenerContainer.java:824)
	at
org.springframework.core.task.SimpleAsyncTaskExecutor$ConcurrencyThrottlingRunnable.run(SimpleAsyncTaskExecutor.java:203)
	at java.lang.Thread.run(Unknown Source)
Caused by: java.io.EOFException
	at java.io.DataInputStream.readInt(Unknown Source)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:267)
	at
org.apache.activemq.transport.tcp.TcpTransport.readCommand(TcpTransport.java:156)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:136)
	... 1 more
Feb 6, 2007 1:28:06 AM
org.springframework.jms.listener.DefaultMessageListenerContainer
refreshConnectionUntilSuccessful
INFO: Successfully refreshed JMS Connection 




Any idea why can’t reconnect?

-- 
View this message in context: http://www.nabble.com/Problems-reconnecting-when-the-broker-break-down-tf3182279.html#a8831646
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Problems reconnecting when the broker break down

Posted by James Strachan <ja...@gmail.com>.
On 2/6/07, cafe <rm...@estudiantes.uci.cu> wrote:
>
> so, you recommend to use for JmsTemplate a PooledConnectionFactory and for
> DefaultMessageListenerContainer a simple ActiveMQConnectionFactory?
>
> do you agreed?

Yes.
-- 

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

Re: Problems reconnecting when the broker break down

Posted by cafe <rm...@estudiantes.uci.cu>.
so, you recommend to use for JmsTemplate a PooledConnectionFactory and for
DefaultMessageListenerContainer a simple ActiveMQConnectionFactory? 

do you agreed?
-- 
View this message in context: http://www.nabble.com/Problems-reconnecting-when-the-broker-break-down-tf3182279.html#a8832235
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Problems reconnecting when the broker break down

Posted by James Strachan <ja...@gmail.com>.
On 2/6/07, cafe <rm...@estudiantes.uci.cu> wrote:
>
> thx James I forget the failover word.
>
> "FWIW there's generally no point using a PooledConnectionFactory when
> using Springs DefaultMessageListenerContainer. The
> PooledConnectionFactory is really mostly for using Spring's
> JmsTemplate (i.e. for sending). For consuming it does not do any
> pooling."
>
> I'm using a JmsTemplate too, but in the DefaultMessageListenerContainer's
> connectionFactory property I can use the PooledConnectionFactory  or not?

You can but its probably better to not as it doesn't add any value
(and could introduce a bug). Though it *should* work, just not been
heavily tested.

-- 

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

Re: Problems reconnecting when the broker break down

Posted by cafe <rm...@estudiantes.uci.cu>.
thx James I forget the failover word.

"FWIW there's generally no point using a PooledConnectionFactory when
using Springs DefaultMessageListenerContainer. The
PooledConnectionFactory is really mostly for using Spring's
JmsTemplate (i.e. for sending). For consuming it does not do any
pooling."

I'm using a JmsTemplate too, but in the DefaultMessageListenerContainer's
connectionFactory property I can use the PooledConnectionFactory  or not?





James.Strachan wrote:
> 
> On 2/6/07, cafe <rm...@estudiantes.uci.cu> wrote:
>>
>> In my app I'm using activeMQ4.1.0 and spring 2.0. and I have configured a
>> DefaultMessageListenerContainer and a PooledConnectionFactory.
> 
> FWIW there's generally no point using a PooledConnectionFactory when
> using Springs DefaultMessageListenerContainer. The
> PooledConnectionFactory is really mostly for using Spring's
> JmsTemplate (i.e. for sending). For consuming it does not do any
> pooling.
> 
> What URL are you using to connect to the broker?
> 
> e.g.
> 
> http://activemq.apache.org/how-can-i-support-auto-reconnection.html
> 
> -- 
> 
> James
> -------
> http://radio.weblogs.com/0112098/
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-reconnecting-when-the-broker-break-down-tf3182279.html#a8832056
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Problems reconnecting when the broker break down

Posted by James Strachan <ja...@gmail.com>.
On 2/6/07, cafe <rm...@estudiantes.uci.cu> wrote:
>
> In my app I'm using activeMQ4.1.0 and spring 2.0. and I have configured a
> DefaultMessageListenerContainer and a PooledConnectionFactory.

FWIW there's generally no point using a PooledConnectionFactory when
using Springs DefaultMessageListenerContainer. The
PooledConnectionFactory is really mostly for using Spring's
JmsTemplate (i.e. for sending). For consuming it does not do any
pooling.

What URL are you using to connect to the broker?

e.g.

http://activemq.apache.org/how-can-i-support-auto-reconnection.html

-- 

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