RE: [SPAM] - [lingo-user] Lingo and service reconnects - Email found in subject

View: New views
1 Messages — Rating Filter:   Alert me  

RE: [SPAM] - [lingo-user] Lingo and service reconnects - Email found in subject

by dbell :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Jerome,
 
If I understand your question.... You can supply failover parameters to your ActiveMqConnectionFactory bean for your client. This should attempt to connect until it has a connection. If I remember correctly supplying 0 to the maxReconnectAttempts will allow it to attempt until it gets a connection.
 
e.g.
 

<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory">

<property name="brokerURL" value="failover:(tcp://[SERVER]:[PORT])?maxReconnectAttempts=[SOME_VALUE]&amp;establishConnectionTimeout=10000&amp;keepAliveTimeout=300000"/>

</bean>



From: Jerome Banks [mailto:jerome.banks@...]
Sent: Wednesday, December 20, 2006 4:31 PM
To: user@...
Subject: [SPAM] - [lingo-user] Lingo and service reconnects - Email found in subject

 
 Hey Folks,
   We've got a simple Lingo configuration with running services with embedded brokers, and clients connected with the "tcp" connector. This creates a single socket between client and server which is re-used for all requests, which is what we want. If the server goes down, however, even for a few moments, (or more likely, we lose network connectivity), all our clients end up throwing IllegalStateException, complaining that "The Session is closed".
 
    Is there some way to get the client to reconnect? What would be appropriate call?  The "failover" connector seems to almost work, but doesn't handle the case where the server is down when the client is initializing, as well as a few other cases.
 
   My only other idea would be to add some Spring AOP interceptor, to check the state, and create a new Connection if it looks like it is closed.  Any ideas for a good entry point into Lingo for such an interceptor? JmsProducerConfig has methods to createConnection(), and createSession().  Can I be certain that Lingo will use these methods to create Connections ???
 
thx ...
 
 jerome
LightInTheBox - Buy quality products at wholesale price