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

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

    Hi,

    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">
    <interceptors>
    <wire-tap channel="logger" />
    </interceptors>
    </channel>
    <channel id="outputChannel">
    <interceptors>
    <wire-tap channel="logger" />
    </interceptors>
    </channel>

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

    <chain input-channel="inputChannel"
    output-channel="splitterInputChannel">

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

    </chain>

    <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...

    Comment

    Working...
    X