0 Replies Latest reply on Oct 26, 2004 9:33 AM by Wolf-Dieter Fink

    Message delivering during shutdown JBoss 3.2.4

    Wolf-Dieter Fink Master

      We are using JBossMQ in catalog management project and during our load tests we have observed the following behaviour.

      On a shutdown of JBoss with JBossMQ a queue message is delivered more than ONCE.


      For reproduction we use the following szenario:
      One JBoss, no cluster
      One sender, many listeners are attached to the queue
      JBoss 3.2.6 downloaded zip unpack... and start (with default configuration)

      If I send a message and one listener executes the onMessage method while I start the JBoss shutdown then
      ALL listeners receive this message with a new message redelivered count.

      Is that a programmers fault or a bug ?


      thanks for reply

      Wolf


      The JBoss logging message was:

      14:54:31,089 WARN [org.jboss.mq.server.BasicQueue] Error during stop - removing subscriber Subscription[subId=-2147483648connection=Connect
      ionToken:ID:5/0cc260fa86d1fa11b7396a035c117fa7 destination=QUEUE.testQueue messageSelector=null Local Create]
      javax.jms.InvalidDestinationException: The subscription was registered with a destination that does not exist !
       at org.jboss.mq.server.ClientConsumer.removeSubscription(ClientConsumer.java:246)
       at org.jboss.mq.server.BasicQueue.stop(BasicQueue.java:640)
       at org.jboss.mq.server.JMSQueue.close(JMSQueue.java:152)
       at org.jboss.mq.server.JMSDestinationManager.closeDestination(JMSDestinationManager.java:806)
       at org.jboss.mq.server.jmx.DestinationMBeanSupport.stopService(DestinationMBeanSupport.java:138)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalStop(ServiceMBeanSupport.java:319)
       at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:223)
       at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:837)
       at $Proxy18.stop(Unknown Source)
       at org.jboss.system.ServiceController.stop(ServiceController.java:449)
       at org.jboss.system.ServiceController.stop(ServiceController.java:440)
       at org.jboss.system.ServiceController.stop(ServiceController.java:440)
       at org.jboss.system.ServiceController.stop(ServiceController.java:440)
       at org.jboss.system.ServiceController.stop(ServiceController.java:440)
       at sun.reflect.GeneratedMethodAccessor78.invoke(Unknown Source)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:176)
       at $Proxy4.stop(Unknown Source)
       at org.jboss.deployment.SARDeployer.stop(SARDeployer.java:285)
       at org.jboss.deployment.MainDeployer.stop(MainDeployer.java:492)
       at org.jboss.deployment.MainDeployer.undeploy(MainDeployer.java:475)
       at org.jboss.deployment.MainDeployer.shutdown(MainDeployer.java:362)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
       at java.lang.reflect.Method.invoke(Method.java:324)
       at org.jboss.mx.server.ReflectedDispatcher.dispatch(ReflectedDispatcher.java:60)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:61)
       at org.jboss.mx.server.Invocation.dispatch(Invocation.java:53)
       at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
       at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:185)
       at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:473)
       at org.jboss.system.server.ServerImpl$ShutdownHook.shutdownDeployments(ServerImpl.java:884)
       at org.jboss.system.server.ServerImpl$ShutdownHook.shutdown(ServerImpl.java:859)
       at org.jboss.system.server.ServerImpl$ShutdownHook.run(ServerImpl.java:846)
      




      Sender will send with a not transacted Session and AUTO_ACKNOWLEDGE

      Listener:
      .... start Listener() {
       QueueConnectionFactory qcf = (QueueConnectionFactory)iniCtx.lookup("UIL2ConnectionFactory");
       QueueConnection conn = qcf.createQueueConnection();
       Queue que = (Queue) iniCtx.lookup("queue/testQueue");
       QueueSession session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE);
      
      
       QueueReceiver recv = session.createReceiver(que);
       recv.setMessageListener(new QueueListener());
       conn.start();
       ......}
      
       public class QueueListener implements MessageListener {
       public void onMessage(Message msg) {
       TextMessage m = (TextMessage)msg;
       try {
       System.out.println("onMessage() : "+new java.text.SimpleDateFormat("yyyyMMdd HHmmssSSS").format(new Date())+"\n"+msg);
       try {
       System.out.println("WAIT");
       Thread.sleep(10000);
       System.out.println("WAIT END");
       }catch(InterruptedException e) {}
       }catch(Throwable t) {
       t.printStackTrace();
       }
       System.out.println("ENDE onMessage()");
       }
       }