Results 1 to 3 of 3

Thread: Multithreading with Spring Integration

  1. #1
    Join Date
    Aug 2009
    Posts
    11

    Default 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. #2
    Join Date
    Jan 2008
    Location
    Mohnton, PA USA (that's near Philadelphia)
    Posts
    2,148

    Default

    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

  3. #3
    Join Date
    Aug 2009
    Posts
    11

    Default

    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"/>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •