Announcement Announcement Module
Collapse
No announcement yet.
Multithreading with Spring Integration Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multithreading with Spring Integration

    Let us assume that you have one consumer which is tied to an input channel. So, when a message is received on a channel, the consumer's 'consume' method is called.

    From what I figured, one would have to use a Thread-Pool, send the message to a single thread and place the thread back on the thread-pool when processing the message is done.

    My question is, if there is a way in which SI can handle this for you? i.e. when a message is received on the channel, SI would spawn a new thread to consumer that message.

    Thanks.
    Chris

  • #2
    Actually, there are many different ways of doing it.
    For example you can configure task-executor attribute on your consumer. You can also configure a dispatcher with task-executor for channels etc. . .
    I would suggest to look through documentation http://static.springsource.org/sprin...reference.html to see various ways of accomplishing this.
    Just do a String search on the word task-executor
    Cheers

    Comment


    • #3
      Hi Oleg,

      I have managed to achieve that using the message-driven-channel adapter using the 'concurrent-consumers' property:

      Code:
      <integration-jms:message-driven-channel-adapter id="inboundEmailGateway1"
                                                          destination="emailQueue1" channel="emailChannel1"
                                                          concurrent-consumers="10" extract-payload="true"/>

      Comment

      Working...
      X