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

Allow seda producers to offer data to the queue with timeout

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.21.0
    • 2.22.0
    • camel-core
    • None
    • Moderate

    Description

      The seda producer only allows:

      • adding with possible exception if queue is full
      • blocking until space is available

      I'd like to suggest a third option for seda where a configured timeout can be added to the block case.  Utilizing the .offer(timeout) method of the underlining java queue

      Use Case:

      I have a Apache NiFi system doing rest posts to my Apache Camel system.  The camel system attempt to put the received message onto a seda queue which is backed by a SynchronousQueue.  This causes an exception to occur if no threads are available to do the work requested, returns a service temporarily unavailable status to NiFi and Nifi pauses it's rest posts for a short delay. 

      I'd be able to save on some network traffic I/O if I was able to say try and wait 100ms before giving up on putting the data on the queue.

       

      Concept of adding the "offer/timeout" was suggested in comments of CAMEL-1962

      Attachments

        Activity

          People

            acosentino Andrea Cosentino
            ragnarotech Andrew Doumaux
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: