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

EventDrivenPollingConsumer can lose exchanges when the internal queue is full

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 2.13.0
    • 2.12.4, 2.13.1, 2.14.0
    • camel-core
    • None
    • Unknown

    Description

      The exchange processing in the EventDrivenPollingConsumer can lose exchanges when the internal queue is bounded and full.

      The implementation:

      public void process(Exchange exchange) throws Exception {
          queue.offer(exchange);
      }
      

      The reason is that BlockingQueue.offer(...) is non-blocking and returns a boolean which indicates whether the element was added.
      However, the return value is ignored causing the exchange to get lost if it could not be added.

      A potential workaround is to use an unbounded BlockingQueue (e.g. LinkedBlockingQueue).

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            bwaldvogel Benedikt Waldvogel
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: