JMSContainerInvoker and ExceptionListenerImpl
sozonnik Oct 31, 2003 6:32 AMHello guys !
First I had 2 JBoss's 3.2.1 on different machines. One server had queue and another server had MDB connected to remote queue. I'v used OIL2.
Than firewall appears between servers, in such way, that only server with MDB can create network connections to other server and only to limited number of ports, but not otherwise.
So I had replace JNDI initial context factory to org.jboss.naming.HttpNamingContextFactory , JNDI lookups works perfectly, but MDB unable to bind to qeuue. After some investigations I found that JBossMQProvider hard coded with org.jnp.interfaces.NamingContextFactory. I changed source code and bring out it as parameter to jboss-service.xml and set it to org.jboss.naming.HttpNamingContextFactory. After that everething begin to work.
First my question is: I think that it is non standart way, but I was unable to make RMI works over my network condition. What is the standart way ?
Then I begin to test reconnection in case of some failures. And I discovered that in reconnect loop of
ExceptionListenerImpl when it try co create service org.jboss.naming.HttpNamingContextFactory throws IOException, loop goes to another turn an then Thread.sleep(reconnectInterval); throw InterruptedException and onException method exits, so connection will newer reconnected ! I saw to my old confifuration with simple RMI when connection losts reconnect loop FINISHED NORMALLY !!
I have JMSContainerInvoker revision 1.50.2.6
So
invoker.innerStop();
invoker.destroyService();
invoker.startService();
brings to:
12:38:55,138 INFO [JMSContainerInvoker] Trying to reconnect to JMS provider
12:39:05,148 ERROR [JMSContainerInvoker] Could not stop JMS connection
12:39:05,151 INFO [DLQHandler] Stopping
12:39:05,156 ERROR [DLQHandler] Stopping failed
org.jboss.mq.SpyJMSException: Cannot disable the connection with the JMS server; -
12:39:05,161 INFO [DLQHandler] Destroying
12:39:05,165 ERROR [DLQHandler] Destroying failed
org.jboss.mq.SpyJMSException: Cannot close properly the connection; -
12:39:05,169 INFO [DLQHandler] Destroyed
12:39:05,173 ERROR [JMSContainerInvoker] Failed to close connection consumer
12:39:05,201 ERROR [JMSContainerInvoker] Failed to close connection
12:39:05,209 INFO [DLQHandler] Creating
12:39:05,373 ERROR [DLQHandler] Initialization failed
12:39:05,377 INFO [JMSContainerInvoker] Reconnected to JMS provider <----- HOW CAN IT BE ?
12:39:05,380 WARN [JMSContainerInvoker] JMS provider failure detected: <---- onException called again
But this is not the biggest problem. If I remove return when InterruptedException thrown it work well ! BUT ! Loop works with high speed without sleepeng, and id is very bad.
So my second question: Who calls Thread.interrupt(); and make reconnect thread to exit ?