2 Replies Latest reply on Nov 19, 2004 2:45 PM by Marcelo Klein

    JBossMQ Fire & Forget

    Marcelo Klein Newbie

      Hi, we' ve been using JBossMQ since JBoss 3.0.8, a long time ago.
      We were testing JMS against a lot of bad conditions, like a 64 KB internet connection, many clients, long ping times, and many others.
      However there's been a test case that is not working properly. If we have already established a client connection to a Queue in the server, and set up the firewall to block the JMS ports (ie 8093, 1099, 1098), and do a sender.send(msg), the thread blocks completely until we open the ports again. This does not comply with the 'Fire and Forget' you mention in the Wikis....
      Any idea if this is ok or there might be a solution?

      Here's the client code:

       ObjectMessage objMsg;
       try {
       objMsg = queueSession.createObjectMessage();
       objMsg.setJMSReplyTo(tempQueue);
       objMsg.setObject(sendEvent);
       sender.send(objMsg, DeliveryMode.NON_PERSISTENT,sendEvent.getPriority(),msg_ttl);
       } catch (JMSException e) {
       e.printStackTrace();
       throw new ConnectionException(e.getMessage());
       }
      


      The queueSession and the temporaryQueue are already created. This code executes every time I send a message to the server.

      Any help will be appreciated.
      Thanks a lot,
      Marcelo.

        • 1. Re: JBossMQ Fire & Forget
          Elias Ross Master


          Eventually, the JMS code should give up and throw some sort of java.net.SocketException . This might take the O/S 3-5 minutes. Does this not eventually happen?

          "Fire and forget" does not mean complete asynchronous operation. When you send a message, the operation will only return until the message is on the server (and persisted). "Fire and forget" means once the message is enqueued, you do not have to wait until it is processed.

          I'm not sure closing the firewalled ports in the middle of a socket connect is going to work. I don't think the firewall cares one bit if you have a socket connection or not, it can still block the traffic.

          You can get a stack trace and post it here.

          • 2. Re: JBossMQ Fire & Forget
            Marcelo Klein Newbie

            Yes after a few minutes my JMS onException method is callled.
            But, shouldn't JMS be asychronous in the client side? I mean, shold we wait the message to arrive to the server, to resume the thread? I don't think this is good for anyone!
            I don't want to think that I should create a separate thread to do a sender.send(message), or shoud I?
            If you have an idea, please tell me!
            Thanks a lot,
            Marcelo