title: Spring integration MessageQueue without polling
body: <p>I'd like to write incoming messages into a message queue and have the messages consumed by a single, dedicated thread without a delay - very similar to <a href="https://stackoverflow.com/questions/41410979/spring-integration-listen-on-queue-without-poller">Spring Integration listen on queue without poller</a></p>
  
  <p>I tried:</p>
  
  <pre><code>IntegrationFlows
    .from("inbound")
    .channel(MessageChannels.queue(10_000))
    .bridge(spec -&gt; spec.poller(Pollers.fixedDelay(0).receiveTimeout(Long.MAX_VALUE)))
    .fixedSubscriberChannel()
    .route(inboundRouter())
    .get()
  </code></pre>
  
  <p>But this causes a task scheduler thread to schedule the polling operation, which will then block until a message is available. This is not my idea of a "dedicated thread" and causes a deadlock in my application if the task scheduler threads are also being used to write into the queue, and then there is no consumer thread left on the other side.</p>
  
  <p>Next thing I tried was:</p>
  
  <pre><code>IntegrationFlows
    .from("inbound")
    .channel(MessageChannels.queue(10_000))
    .bridge(spec -&gt; spec.poller(Pollers.fixedDelay(0).taskExecutor(Executors.newSingleThreadExecutor()).receiveTimeout(Long.MAX_VALUE)))
    .fixedSubscriberChannel()
    .route(inboundRouter())
    .get()
  </code></pre>
  
  <p>But this caused the application to spawn a gazillion of scheduled tasks, because of <code>fixedDelay(0)</code>.</p>
  
  <p>Next option I came across was:</p>
  
  <pre><code>IntegrationFlows
    .from("inbound")
    .channel(MessageChannels.executor(Executors.newSingleThreadExecutor()))
    .route(inboundRouter())
    .get()
  </code></pre>
  
  <p>This seems to work as intended; I have a dedicated thread that processes all messages. However, I do no longer have a message queue whose statistics I can monitor (via JMX).</p>
  
  <p>So, is there any way to achieve my goal, and how?</p>