int-ip:udp-inbound-channel-adapter
我想将我的 XML 配置转换为 Java dsl,但我在 java dsl 中找不到示例。有TcpNetServerConnectionFactory
TCP,但没有 UDP。只有那个类是子类化AbstractServerConnectionFactory
。与 Spring 集成相关的 XML 配置如下。
<int-ip:udp-inbound-channel-adapter
id="receiverChannel" channel="udpReceivedChannel" port="1206" multicast="false"
check-length="false" lookup-host="false" pool-size="20"/>
<int:transformer id="convertTransformer" input-channel="convertChannel"
output-channel="toProcessChannel" ref="transformer" method="transform">
</int:transformer>
<int:service-activator id="accumulateActivator" input-channel="udpReceivedChannel"
output-channel="convertChannel"
ref="accumulator" method="accumulate">
</int:service-activator>
<int:service-activator id="cssenderAcivator" input-channel="sendToCMSChannel"
ref="cssender" method="sendToCS">
</int:service-activator>
<int:service-activator id="jackpotRaiseActivator" input-channel="toProcessChannel"
ref="jackpotraise" method="raise" >
</int:service-activator>
<int:service-activator id="jackpotScreenActivator" input-channel="jackpotScreenChannel"
ref="jackpotscreen" method="updateJackpotsOnDisplay" >
</int:service-activator>
<int:channel id="udpReceivedChannel">
<int:dispatcher task-executor="accumulateExecutor"/>
<!--<int:queue message-store="redisMessageStore"/>--> <!-- ovo nam ne treba bez da nesto externo trpa u redis-->
</int:channel>
<int:channel id="toProcessChannel">
<int:dispatcher task-executor="jackpotRaiseExecutor"/>
<int:interceptors>
<int:wire-tap channel="sendToCMSChannel"/>
</int:interceptors>
</int:channel>
<int:channel id="convertChannel">
<int:dispatcher task-executor="transformerExecutor"/>
</int:channel>
<int:channel id="sendToCMS">
<int:dispatcher task-executor="cmsSenderExecutor"/>
</int:channel>
<int:channel id="jackpotScreenChannel">
<int:dispatcher task-executor="jackpotScreenExecutor"/>
</int:channel>
<task:executor id="accumulateExecutor" pool-size="20" keep-alive="120" />
<task:executor id="jackpotRaiseExecutor" pool-size="20" keep-alive="120" />
<task:executor id="transformerExecutor" pool-size="20" keep-alive="120" />
<task:executor id="cmsSenderExecutor" pool-size="20" keep-alive="120" />
<task:executor id="jackpotScreenExecutor" pool-size="400" keep-alive="500" />