Announcement Announcement Module
Collapse
No announcement yet.
publish-subscribe channel alternative? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • publish-subscribe channel alternative?

    Code:
        <si:publish-subscribe-channel id="comp.toMultipleChannels"/>
        
        <si:router input-channel="comp.toRouter" ref="comp.router" method="route"/>
        
        <bean id="comp.router" class="com.xxx.MessageTypeRouter">
            <property name="name" value="oms.postProcessingRouter"/>
            <property name="destinations">
                <map>
                    <entry key="TYPE1" value="comp.toMultipleChannels"/> 
                    <entry key="TYPE2" value="comp.toMultipleChannels"/> 
                    <entry key="TYPE3" value="comp.toMultipleChannels"/> 
                    <entry key="TYPE4" value="comp.toMultipleChannels"/> 
                    <entry key="TYPE5" value="comp.toMultipleChannels"/> 
                </map>
            </property>
            <property name="defaultDestination" value="comp.broadcast"/>
        </bean>
        <si:bridge input-channel="comp.toMultipleChannels" output-channel="comp.broadcast"/>
        <si:bridge input-channel="comp.toMultipleChannels" output-channel="comp.toQueue"/>
    Message goes in from "comp.toRouter" and based upon the Type of message, it gets routed to comp.toMultipleChannels or comp.broadcast.

    We are currently using a publish-subscribe channel. Is there any other way to put the message into multiple channels other than publish-subscribe channel?

    If not, does subscribed channel(comp.broadcast/comp.toQueue) start a new thread when it is reading from the published channel(comp.toMultipleChannels)?
    Last edited by srikanthradix; Jun 21st, 2010, 01:54 PM.

  • #2
    How about this way?

    Code:
        <si:router input-channel="comp.toRouter" ref="comp.router" method="route"/>
        
        <bean id="comp.fatRouter" class="com.xxx.MessageTypeRouter">
                <property name="name" value="comp.postProcessingRouter"/>
                <property name="destinations">
                    <map>
                        <entry key="TYPE1">
                            <list>
                                <value>comp.broadcast</value>
                                <value>comp.toQueue</value>
                            </list>
                        </entry>
                        <entry key="TYPE2">
                            <list>
                                <value>comp.broadcast</value>
                                <value>comp.toQueue</value>
                            </list>
                        </entry>
                        <entry key="TYPE3">
                            <list>
                                <value>comp.broadcast</value>
                                <value>comp.toQueue</value>
                            </list>
                        </entry>
                        <entry key="TYPE4">
                            <list>
                                <value>comp.broadcast</value>
                                <value>comp.toQueue</value>
                            </list>
                        </entry>
                        <entry key="TYPE5">
                            <list>
                                <value>comp.broadcast</value>
                                <value>comp.toQueue</value>
                            </list>
                        </entry>
                    </map>
                </property>
                <property name="defaultDestination" value="comp.broadcast"/>
        </bean>
    If I use this way, is there any disadvantage over using publish-subscribe channel?
    Last edited by srikanthradix; Jun 21st, 2010, 01:54 PM.

    Comment

    Working...
    X