In our setup we are running multi-server JBM cluster hosting clustered queues. We have a client application that looks up ClusteredConnectionFactory from a server from this cluster (this is configured in the client application ) and then uses createConnection to create sessions across different servers in the cluster.
This setup works fine and our messaging load gets almost equally distributed amongst the servers in the cluster.
We currently have an issue with the server application that causes a JBOSS server to go down sometimes. Because of the cluster we still overall have a availability of the application with remaining servers, but we face issues with the client application if it has to create new connections.
Problems we face is that the
-- Though there are servers availabile in the cluster the client is not able to do JNDI Lookup of the ClusteredConnectionFactory if the server that has gone down is the one that is being used in the application for JNDI lookup.
We have considered implementing custom failover mechanism for lookup (to go around servers in the cluster until succeeded) as an option.
We do want to explore other options if any available before taking this route.
-- Suppose we cache the looked up ClusteredConnectionFactory and never lookup again for the duration of the client applications life, will the object reference be valid for creating connections if the original server from where the lookup was made has gone down i.e. this ConnectionFactory is JMS cluster aware and hence can use other servers while creating connections on the client side?
Use HAJNDI for the lookup, then it won't matter if the server is down.
See wiki for more info (also see JBoss AS docs)