java - Spring integration Splitter task execution -


i'm working on spring integration application.

i have inbound channel adapter read directory splitter split file lines udp outbound channel adapter sends lines

<int-file:inbound-channel-adapter prevent-duplicates="false"           id="filesin" directory="file:input" channel="inputfiles" />  <int:splitter  input-channel="inputfiles" output-channel="udpchannel_11111"          expression="t(org.apache.commons.io.fileutils).lineiterator(payload)" />  <!-- define udp outbound channel --> <int:channel id="udpchannel_11111" /> <int-ip:udp-outbound-channel-adapter channel="udpchannel_11111"         host="192.168.0.1" port="11111" /> 

i send line every 1 second

i can define own splitter , wait 1s each time read line, know if it's possible in xml file simple possible.

thanks in advance

put messages in queuechannel , use poller send once second.

the udp channel adapter doesn't support poller, can use bridge...

<int:splitter  input-channel="inputfiles" output-channel="udpchannel_11111"      expression="t(org.apache.commons.io.fileutils).lineiterator(payload)" />  <int:channel id="tobridge">     <int:queue /> </int:channel>  <int:bridge input-channel="tobridge" output-channel="udpchannel_11111">     <int:poller fixed-delay="1000" max-messages-per-poll="1" /> </int:bridge> 

bear in mind, though, file loaded queue channel , may have memory issues if it's large.


Comments

Popular posts from this blog

How to connect android app to App engine -

gcc - MinGW's ld cannot perform PE operations on non PE output file -

php - display validation error message next to the textbox in codeigniter -