8 Replies Latest reply on May 21, 2010 9:52 AM by alesj

    Deployment ordering on HornetQ destinations and MDBs

    clebert.suconic

      We have an issue where our destinations are being deployed after the MDBs on EAP 5.1 @ hornetq.

       

      Users can define dependencies to other POJOs.. but we don't want to force users to do that, if they deploy the whole thing at the same time. We would like to have the priorities tweaks in a certain way destinations would always deploy before the MDBs if everything is together:

       

       

       

       

      Here's the scenario:

       

      The application server has:

       

      - HornetQJMSParseDeployment that will produce JMSConfiguration which is an input for the real deployer

      - HornetQJMSRealDeployer that will produce POJOs that will depend on the HornetQ Server and will produce the destinations.

      - StandardJBossMetaDataDeployer (from the server project)

       

       

      Up to HornetQJMSRealDeployer everything seems ok.. It's all happening before StandardJBossMetaDataDeployer, however the Bean deployed as part of the Real deployer will only be initialized after the whole deployment context was finished.

       

       

      Which doesn't seem to be the same behaviour taken by AS 6.

       

       

      We have created a branch of the EAP 5.1...  maybe this is an issue that was fixed later on?

       

      https://svn.jboss.org/repos/jbossas/branches/JBPAPP_5_1_hornetq-int/

       

       

      if you have time to reproduce the issue.. you have download this branch ^^

       

      after building it, go to ./build/output/jboss-server/extras/hornetq

       

      execute ./switch.sh

       

      # we will take care of this step later

      remove hornetq/examples/javaee/common/config/ant.propertie

       

       

      cd build//output/jboss-server/extras/hornetq/example/javaee/bmt

       

      ant deploy

       

       

       

      You will see an error while deploying the MDB.

       

       

       

      But most of the debug information I've taken is already here.

       

       

      Any help would be appreciated... thanks a lot

       

       

       

        • 1. Re: Deployment ordering on HornetQ destinations and MDBs
          alesj

          How's this handled in AS6?

          e.g. forcing MDBs to wait on your queues

           

          What about if you simply move HornetQJMSRealDeployer to PRE_REAL?

          • 2. Re: Deployment ordering on HornetQ destinations and MDBs
            clebert.suconic

            On 6, As far as I know the POJOs will be flushed as soon as I create them on the RealDeployer. We can double check this.

             

            >> What about if you simply move HornetQJMSRealDeployer to PRE_REAL? <<

             

            What that means?

            • 3. Re: Deployment ordering on HornetQ destinations and MDBs
              alesj
              On 6, As far as I know the POJOs will be flushed as soon as I create them on the RealDeployer. We can double check this.

              Flushed?

              You mean installed all the way?

               

              What's stopping them now?

               

              >> What about if you simply move HornetQJMSRealDeployer to PRE_REAL? <<

               

              What that means?

              Change its DeploymentStage from REAL to PRE_REAL.

              • 4. Re: Deployment ordering on HornetQ destinations and MDBs
                jmesnil

                Changing HornetQJMSRealDeployer to PRE_REAL does not fix the issue: the POJO are sill deployed too "late" (after the MDB is activated).

                 

                We need to find a way to deploy the POJO from HornetQJMSRealDeployer after the HornetQ server is started and before the MDBs are activated

                • 5. Re: Deployment ordering on HornetQ destinations and MDBs
                  jmesnil

                  by the way, I tried to load our mdb-bmt example in AS 6 M3 and I have the same issue:

                   

                  16:05:46,061 ERROR [HornetQActivation] Unable to start activation : HornetQException[errorCode=100 message=Queue jms.queue.testQueue does not exist]
                  at org.hornetq.core.protocol.core.impl.ChannelImpl.sendBlocking(ChannelImpl.java:287) [:6.0.0.20100429-M3]
                  at org.hornetq.core.client.impl.ClientSessionImpl.internalCreateConsumer(ClientSessionImpl.java:1556) [:6.0.0.20100429-M3]
                  at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:447) [:6.0.0.20100429-M3]
                  at org.hornetq.core.client.impl.ClientSessionImpl.createConsumer(ClientSessionImpl.java:392) [:6.0.0.20100429-M3]
                  at org.hornetq.core.client.impl.DelegatingSession.createConsumer(DelegatingSession.java:201) [:6.0.0.20100429-M3]
                  at org.hornetq.ra.inflow.HornetQMessageHandler.setup(HornetQMessageHandler.java:168) [:6.0.0.20100429-M3]
                  at org.hornetq.ra.inflow.HornetQActivation.setup(HornetQActivation.java:287) [:6.0.0.20100429-M3]
                  at org.hornetq.ra.inflow.HornetQActivation$SetupActivation.run(HornetQActivation.java:502) [:6.0.0.20100429-M3]
                  at org.jboss.resource.work.WorkWrapper.run(WorkWrapper.java:172) [:6.0.0.20100429-M3]
                  at org.jboss.threads.SimpleDirectExecutor.execute(SimpleDirectExecutor.java:33) [:6.0.0.20100429-M3]
                  at org.jboss.threads.QueueExecutor.runTask(QueueExecutor.java:780) [:6.0.0.20100429-M3]
                  at org.jboss.threads.QueueExecutor.access$100(QueueExecutor.java:45) [:6.0.0.20100429-M3]
                  at org.jboss.threads.QueueExecutor$Worker.run(QueueExecutor.java:800) [:6.0.0.20100429-M3]
                  at java.lang.Thread.run(Thread.java:637) [:1.6.0_17]
                  at org.jboss.threads.JBossThread.run(JBossThread.java:122) [:6.0.0.20100429-M3
                  
                  
                  • 6. Re: Deployment ordering on HornetQ destinations and MDBs
                    alesj
                    We need to find a way to deploy the POJO from HornetQJMSRealDeployer after the HornetQ server is started and before the MDBs are activated

                    POJO X then needs an explicit dependency on the HornetQ server.

                    At the same time you then need to add a dependency on X to MDB's dependencies.

                    • 7. Re: Deployment ordering on HornetQ destinations and MDBs
                      jmesnil

                      After talking to carlo this morning, I have updated HornetQ RA activation code so that it attempts multiple time to setup if there is an issue (connection failure, destination not bound, etc.)

                       

                      This means that eventually the MDB will be properly activated once HornetQ AS deployers will have deployed their resources.

                      However this is suboptimal: on server start, we have a WARNING and a reconnection attempt because the MDB is activated before HornetQ resources are deployed.

                       

                      AIUI, this brings HornetQ RA code on par with AS generic RA.

                      It seems the same deployment ordering issue is also present when using AS generic RA and JBoss Messaging: http://wwwapps.rdu.redhat.com/w3xpastebin/pastebin.php?show=19069

                       

                      How can we solve this so that everything is deployed in the correct order, whether it is HornetQ or JBoss Messaging?

                      From the different conversations I had, I understood that it is not possible to have ordering between deployment units. What can we do to ensure the messaging server resources are effectively created before MDBs are activated?

                      • 8. Re: Deployment ordering on HornetQ destinations and MDBs
                        alesj
                        How can we solve this so that everything is deployed in the correct order, whether it is HornetQ or JBoss Messaging?

                        Proper explicit dependencies.

                        From the different conversations I had, I understood that it is not possible to have ordering between deployment units. What can we do to ensure the messaging server resources are effectively created before MDBs are activated?

                        Different top level deployment units or sub-deployment units?

                        Both is possible.

                        * top level deployment units are components inside MC, hence can easily be controlled wrt dependencies

                        * sub-deployment units can be dynamically re-ordered: JBDEPLOY-243