5 Replies Latest reply on Aug 14, 2009 2:54 AM by kconner

    Receive Timeout

      Dear All,

      Sorry for that simple question but I don't find it in the documentation nor from the forum.

      May I know how could I configure the receive(timeoutMillis) for message consumer ? Because I am using JBoss ESB to connect to SonicMQ for receiving messages, which causes the queue to be hanging when the URL fail after some up time. It is suggested by some experienced users that I should set timeout for the receive process instead of waiting indefinitely. So I would like to also know whether JBossESB read from queue using the receive() or receive(timeoutMillis) function by default?

      Thanks a lot.

        • 1. Re: Receive Timeout
          kconner

          We use the receive(timeoutMillis) within the JmsCourier.

          If this happens after a connection issue then it suggests that the reconnect is not working correctly with Sonic. Could you send me a DEBUG log showing the issue?

          Kev

          • 2. Re: Receive Timeout

            Sorry that I may have over-simplified the problem. Actually I suspect it is more of the problem of sonic side instead of ESB.

            The scenario is : there are multiple URL from sonic, they have fail-over, so that when any one of the URL failed to connect, I can connect to another URL to read messages. But now, the problem is whenever one URl is down, I can reconnect to another URL successfully, but messages stuck in the original URL (the dead one) after it is up again. The ESB can then only consumes messages that sent to the altnerative URL.
            And then those "experienced user" suggest us to increase the receive timeout time which they claim this method had solved "similar issues" before.
            And indeed, the log shows re-connecting successful.

            That's the reason I ask if the receive was called via receive() or receive(timeoutMillis).

            Anyway, may I know how could I possibly configure that timeoutMillis ?
            On the other hand, I got the log message that "No value specified for: max-millis-for-response - This will be an 'inbound-only' gateway" when I start the server, may I know where is this value configured as well?


            Thanks a lot.

            • 3. Re: Receive Timeout
              kconner

               

              "oichris" wrote:
              Anyway, may I know how could I possibly configure that timeoutMillis ?

              There is no way to configure the timeout if polling, it is hardcoded in the current codebase, and request/response use the timeout specified on the deliverSync invocation.

              "oichris" wrote:
              On the other hand, I got the log message that "No value specified for: max-millis-for-response - This will be an 'inbound-only' gateway" when I start the server, may I know where is this value configured as well?

              This is from fs-listener or ftp-listener and states that it will only forward files into the ESB. If this is enabled then the gateway will wait for a response from the ESB service but this is inadvisable unless you wish to have each file processed sequentially.

              Did you find anything from the DEBUG logs?

              Kev

              • 4. Re: Receive Timeout

                Thanks Kevin.

                It would be good enough to let me know there is already a receive timeout for polling. So I have more reason to support that the problem lies in the SonicMQ side instead of JBossESB.

                For the DEBUG log, I'm afraid it's not much meaningful, since I both listens to and writes to a SonicMQ, and for writing, I use a bridge (because for writing, ESB does not re-connect automatically, but bridge does). So the debug messages are mostly indicating that bridge is retrying and finally succeeded :

                2009-08-10 16:00:17,735 WARN [org.jboss.jms.server.bridge.Bridge] Failed to set up connections, will retry after a pause of 5000 ms
                2009-08-10 16:00:17,741 WARN [org.jboss.jms.server.bridge.Bridge] Failed to set up connections
                javax.jms.JMSException: java.net.ConnectException: Connection refused: tcp://mysonic:12506
                at progress.message.jimpl.JMSExceptionUtil.createJMSException(Unknown Source)
                at progress.message.jimpl.Connection.(Unknown Source)
                at progress.message.jclient.ConnectionFactory.createConnection(Unknown Source)
                at progress.message.jclient.ConnectionFactory.createConnection(Unknown Source)
                at org.jboss.jms.server.bridge.Bridge.createConnection(Bridge.java:850)
                at org.jboss.jms.server.bridge.Bridge.setupJMSObjects(Bridge.java:944)
                at org.jboss.jms.server.bridge.Bridge.setupJMSObjectsWithRetry(Bridge.java:1152)
                at org.jboss.jms.server.bridge.Bridge.access$1500(Bridge.java:66)
                at org.jboss.jms.server.bridge.Bridge$FailureHandler.run(Bridge.java:1507)
                at java.lang.Thread.run(Thread.java:595)
                2009-08-10 16:00:17,741 WARN [org.jboss.jms.server.bridge.Bridge] Failed to set up connections, will retry after a pause of 5000 ms
                2009-08-10 16:01:10,225 INFO [org.jboss.jms.server.bridge.Bridge] Succeeded in reconnecting to servers

                • 5. Re: Receive Timeout
                  kconner

                  I am not sure about the JMS bridge but you should find that ESB will reconnect on writes now, it was added in ESB 4.6 to address we were seeing with JBM.

                  Kev