Hi ,
I am using HornetQ as our message broker and create connection over JNDI, my jndi props look like the following:
And the spring configuration is as follows:Code:jndi.provider.url=jnp://localhost:1099,jnp://localhost:2099 jndi.factory.init=org.jnp.interfaces.NamingContextFactory jndi.factory.pkgs=org.jboss.naming:org.jnp.interfaces
I have configured the hornetq servers for failover with one as a passive backup which automatically comes up when the active one fails. What I see is that when the live server goes down, the backup server becomes the live one. However on the client side all the connections fail and are not failed over to the new live server. Any help appreciated.Code:<bean id="jndiTemplate" class="org.springframework.jndi.JndiTemplate"> <property name="environment"> <props> <prop key="java.naming.provider.url">${jndi.provider.url}</prop> <prop key="java.naming.factory.initial">${jndi.factory.init}</prop> <prop key="java.naming.factory.url.pkgs">${jndi.factory.pkgs}</prop> </props> </property> </bean> <bean id="connectionFactoryInit" class="org.springframework.jndi.JndiObjectFactoryBean"> <property name="jndiTemplate" ref ="jndiTemplate"/> <property name="jndiName" value="ConnectionFactory"/> </bean> <bean id="userConnectionFactory" class="org.springframework.jms.connection.UserCredentialsConnectionFactoryAdapter"> <property name="targetConnectionFactory"><ref bean="connectionFactoryInit"/></property> <property name="username" value="${jms.user}"></property> <property name="password" value="${jms.pass}"></property> </bean> <bean id="connectionFactory" class="org.springframework.jms.connection.CachingConnectionFactory"> <property name="targetConnectionFactory" ref="userConnectionFactory"></property> <property name="sessionCacheSize" value="10"></property> <property name="reconnectOnException" value="true"></property> </bean>
Error log as
Code:012-12-14 14:49:26,922 [redelivery-scheduler1-thread-1] ERROR [com.clairmail.event.impl.EventMessageDispatcherImpl] SEVERE unable to process event-message to topic javax.jms.IllegalStateException: Connection is closed at org.hornetq.jms.client.HornetQConnection.checkClosed(HornetQConnection.java:593) at org.hornetq.jms.client.HornetQConnection.createSession(HornetQConnection.java:159) at org.springframework.jms.connection.SingleConnectionFactory.createSession(SingleConnectionFactory.java:406) at org.springframework.jms.connection.CachingConnectionFactory.getSession(CachingConnectionFactory.java:225) at org.springframework.jms.connection.SingleConnectionFactory$SharedConnectionInvocationHandler.invoke(SingleConnectionFactory.java:534) at $Proxy48.createSession(Unknown Source)


Reply With Quote
