Announcement Announcement Module
Collapse
No announcement yet.
Two Target channel with same ID Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Two Target channel with same ID

    Hi, im trying to do next thing. I have an String that is send into MessageBus, after some MessageEndpoints, i want that String content is copied inside two directories. I have used next configuration:

    Code:
    <channel id="outputFile"></channel>
    
    	<file-target id="logFile" directory="C:\\Temp" channel="outputFile"/>
    	<file-target id="log2file" directory="C:\\Temp2" channel="outputFile"/>
    And then in Splitter i have next output channel:

    Code:
    @Splitter(channel = "outputFile")
    If only one file target is present, the example works perfectly, but when two file-targets are configured, only first file-target seems to work. Is it the expected behaviour? How can i make to write twice the same information?

    Thank you very much.

    PD: If you want i can upload the code.

  • #2
    By default, channels have "point-to-point" semantics. This means that only one consumer should receive the message. If more than one endpoint is registered as a subscriber to a point-to-point channel, then all such endpoints act as "competing consumers". The first one that is able to accept the message will handle it.

    You should be able to simply modify your channel to have "publish-subscribe" behavior instead by adding the "publish-subscribe" attribute to the channel definition:
    Code:
    <channel id="outputFile" publish-subscribe="true"/>

    Comment

    Working...
    X