0

What configuration of Spring Integration elements, if any, would support the model of:

  • One message queue, representing incoming work
  • Multiple consumers reading from that queue (one message only needs to go to one consumer)
  • Each consumer only polls when it has no work to do; if it is currently processing a message, then don't poll. If it is doing no work, poll every X seconds to see if new work has arrived.
DeejUK
  • 12,891
  • 19
  • 89
  • 169

1 Answers1

1

Assuming you mean with JMS,

<jms:message-driven-channel-adapter/>

See attributes such as concurrent-consumers, max-concurrent-consumers, idle-consumer-limit, idle-task-execution-limit.

The consumer management is all done by the underlying core Spring DefaultMessageListenerContainer.

Gary Russell
  • 166,535
  • 14
  • 146
  • 179
  • Hi Gary, thanks for the answer. My understanding of the channel adapters for messaging infrastructure was that the channel adapter would race away pulling down as many messages as it can and placing them on a Spring Integration 'internal' queue, rather than pulling them off the infrastructure queue at the pace that a downstream service is consuming them? – DeejUK Jul 09 '12 at 08:12
  • No; you control the rate of consumption using the concurrent-consumers attribute; there's no "internal" queue, as long as you don't use asynchronous handoff (only direct channels) in your SI configuration. – Gary Russell Jul 12 '12 at 22:49