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]&establishConnectionTimeout=10000&keepAliveTimeout=300000"/>
</bean>
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