Announcement Announcement Module
No announcement yet.
setting the spring integration channel bean scope to prototype not working Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • setting the spring integration channel bean scope to prototype not working


    I have a requirement to split the incoming messages in to multiple messages and finally aggregate in to one message using spring integration frame work. This is behavior is working fine. Splitter method is returning set of objects and those objects are passing to channel and we found that the splitted messages are executing sequentially, but we want to execute them in parallel. So we thought of making the channel beans to prototype instead of singleton, we can make the execution parallel. But not sure, how
    much this is feasible, can you please suggest me which is very good solution to achive my requirement as per the above comments.

    When we try to add scope="prototype" to channel, for eg : <channel id="inputChannel" scope="prototype">

    we are getting the below exception as

    org.springframework.integration.MessageDeliveryExc eption: failed to send Message to channel 'inputChannel'

    Caused by: java.lang.IllegalStateException: Dispatcher has no subscribers.

    your help is highly appreciated

    Here is the XML configuration we are doing.

    <channel id="inputChannel">
    <wire-tap channel="logger" />
    <channel id="outputChannel">
    <wire-tap channel="logger" />

    <gateway id="inputGateway"
    <method name="method" request-channel="inputChannel"
    reply-channel="outputChannel" reply-timeout="10000"
    request-timeout="10000" />

    <chain input-channel="inputChannel"

    <service-activator method="method" ref="bean" />


    <splitter input-channel="splitterInputChannel"
    output-channel="retOutputChannel" ref="spli"
    method="split" />

  • #2
    IMHO you are using the wrong tool for the job. If you want parallel execution you would need to configure a TaskManager with multiple threads instead of making your channels prototype...