5 Replies Latest reply on Jul 6, 2003 12:44 PM by adrian.brock

    QueueRequestor doesn't receive response

    vprise

      Hi, while I read the discussion at http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t= it seems that no solution was found the problem, other than a discussion of why would that problem need solving (as it can be "emulated" by session beans which isn't accurate) and a solution to a similar problem involving QueueReceiver. Now I realize that QueueRequestor was implemented by Sun, but still I can't seem to get it to work with the following code:

      QueueSession session = connect.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
      Message message = session.createTextMessage("Hey There");
      QueueRequestor requestor = new QueueRequestor(session, queue);
      Message reply = requestor.request(message);
      requestor.close();
      button.setText(((TextMessage)reply).getText());


      This hangs on requestor.request() and never returns.
      The server side is an MDB that receives the message and
      doesn't have any noticeable errors:

      QueueSession session = connect.createQueueSession(true,0);

      Queue queue = (Queue)message.getJMSReplyTo();
      QueueSender sender = session.createSender(queue);
      Message reply = session.createTextMessage("Hi World");
      reply.setJMSCorrelationID(message.getJMSMessageID());
      sender.send(reply);


      I am using JBoss 3.0.6 and my client is a remote Swing client.

        • 1. Re: QueueRequestor doesn't receive response
          vprise

          I just reread the postings I linked and it seems that temporary queues just don't work. Is this assertion correct? I'd really hate for all the clients to share a server based queue, since this doesn't seem to make sense for my purpose.

          • 2. Re: QueueRequestor doesn't receive response
            vprise

            Just verified, my code works as expected in the J2EE RI 1.3.1!

            • 3. Re: QueueRequestor doesn't receive response
              vprise

              The reason I used JBoss 3.0.6 is that 3.2.1 informs me that DefaultJMSProvider is not bound despite the fact that it is within the XML file. I couldn't get deployment to work on JBoss 4.0 alpha, it throws many exceptions on startup and deployment fails. I have no idea why. Anyway I can't use a none production version since our deadline isn't far off and we can't afford tying it to a JBoss release.

              • 4. Re: QueueRequestor doesn't receive response
                vprise

                Again, after further investigation I found a test case for QueueRequestor which I guess runs correctly (otherwise a release wouldn't be made, right?). Anyway it seems to be flawed since it uses the same connection and session etc... to send and receive messages within the same VM. While this might test something, my problem is with two separate VM's and with (obviously) different instances of these members.

                • 5. Re: QueueRequestor doesn't receive response

                  For 3.2.1 you need to set RecursiveSearch to true
                  in server/default/conf/jboss-service.xml

                  For temporary queues, there was a bug in there
                  in previous versions. It should work with the latest
                  versions.

                  I would recommend writing your version of the QueueRequestor
                  that has a timeout if you don't want it to hang forever.

                  Regards,
                  Adrian