1 Reply Latest reply on Oct 19, 2006 5:22 AM by VijayaRaghava Mutharaju

    Strange Problem!!!

    VijayaRaghava Mutharaju Newbie


      Iam sending messages to a queue(MyQueue) using JMS and MDB is consuming them. But the problem is that the MDB is not getting invoked for all messages and this doesn't happen all the time. Sometimes it works perfectly fine and sometimes it doesn't consume any messages or just consumes only some of the messages. I think the configuration is fine.

      Iam using JBoss 4.0.4, EJB 3.0, JavaEE 5.0

      Relevant snippets of configuration files and code are as follows:

      1) jbossmq-destinations-service.xml --- added a new queue

      <depends optional-attribute-name="DestinationManager">

      2) Code using JMS API

      context = new InitialContext();
      connectionFactory =
      destinationName = "queue/MyQueue";
      Queue testExecutionQueue =
      connection = connectionFactory.createConnection();
      session = connection.createSession(false,
      msgProducer = session.createProducer(testExecutionQueue);
      ObjectMessage message = session.createObjectMessage();

      // Close the connection

      3) MDB

      // Only the annotations --- others are not required I guess

      @MessageDriven(activationConfig = {
      propertyValue="queue/MyQueue") })

      Thats it. In the JBoss configuration file, I only changed the file mentioned in 1).

      The problem is strange because it happens sometimes and works perfectly at other times.

      Where am I going wrong?

      Thank you.