3 Replies Latest reply on Dec 17, 2004 6:43 AM by adrian.brock

    Intercepting queue length

    jplsaez22

      Hello.

      I am a newbie in JBoss and I'm quite interested in usig JBossMQ.

      I would like to execute some especific code when the queue depth in a Destination goes under some defined threshold.

      I don't really know how to get it, so any advice will be very appreciated.

      Thank you very much.

      JP

        • 1. Re: New problem deploying MDB in latest code

          Great. I guess the jboss-all vs jboss thing was confusing me. I can build both the 2.5 HEAD revision and the latest 2.4 branch now.

          Getting back to the original question, both these builds are giving me the same problem. I do not have the problem with 2.4.0.

          I create a queue in jboss.jcml like this:



          I then deploy a trivial MDB on it (using auto-deploy directory before starting the server). My jboss.xml looks like this:

          <enterprise-beans>
          <message-driven>
          <ejb-name>TestModule</ejb-name>
          <configuration-name>Standard Message Driven Bean</configuration-name>
          <destination-jndi-name>queue/testModuleQueue</destination-jndi-name>
          ...

          Deployment fails with the error messages in the original post. It seems the server:
          - looks for the testModuleQueue
          - misses it somehow
          - tries to create a temp queue with the same name for the bean deployment
          - fails because there really is a queue deployed with that name already

          If i do not create the queue in jboss.jcml, the server creates a temp queue and deploys the bean on it successfully. But i don't want my bean on a temp queue!

          New info since the original post: If i autodeploy the same bean again (without restarting jboss), i get a new exception:

          [J2eeDeployer] exception while searching deployment:
          java.io.FileNotFoundException: S:\jboss-2.4\jboss\dist\tmp\deploy\Default\my.ear\deployment.cfg (The system cannot find the file specified)
          at java.io.FileInputStream.open(Native Method)
          at java.io.FileInputStream.(Unknown Source)
          at java.io.FileInputStream.(Unknown Source)
          at org.jboss.deployment.InstallerFactory.loadConfig(InstallerFactory.java:264)
          at org.jboss.deployment.InstallerFactory.findDeployment(InstallerFactory.java:198)

          But i also see:
          [Container factory] Deployed application: file:/S:/jboss-2.4/jboss/dist/tmp/deploy/Default/my.ear/
          [J2EE Deployer Default] J2EE application: file:/S:/jboss-2.4/jboss/dist/deploy/my.ear is deployed.

          No destroy message. So the bean does deploy the second time. It also appears to be receiving messages.

          Any further redeployments give the same result.


          • 2. Re: Intercepting queue length

            The only mechanism to do this involves JBoss specifc mechanisms.
            Either through the JMX management interface or by modifiying the JBossMQ code.

            Monitoring the queue depth is not a part of the JMS spec.

            • 3. Re: Intercepting queue length
              jplsaez22

              Ok.

              Should it be possible to set a destination, call it "queue depth under threshold" where the monitored destination could send a JMS message telling the queue depth limit has been reached?

              Could you please tell me some hints about where I should change the code?

              Thank you very much.

              JP