Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-17022

camel-mina - MinaProducer does not disconnect on timeouts

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.11.3, 3.13.0
    • camel-mina
    • None
    • Unknown

    Description

      This is basically a follow up on CAMEL-5404.

      If the "disconnect" parameter is not set on true, the same problem occurs as described in CAMEL-5404 in case of a timeout, i.e. a delayed response may be incorrectly associated with a subsequent request, which leads to disaster.

      To avoid this behavior, "disconnect" could be set to "true" - however, this would close the connection also after each response successfully delivered in time. This causes unnecessary overhead when reopening connections every time.

      Proposal:

              if (sync) {
                  // wait for response, consider timeout
                  LOG.debug("Waiting for response using timeout {} millis.", timeout);
                  boolean done = responseLatch.await(timeout, TimeUnit.MILLISECONDS);
                  if (!done) {
                      # NEW: Force session to be closed on timeouts
                      closeSessionIfNeededAndAwaitCloseInHandler(session);
                      throw new ExchangeTimedOutException(exchange, timeout);
                  } 

      Maybe this behavior can also be tied to a producer-side disconnectOnNoReply parameter.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              christian.ohr christian ohr
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: