在 Spring XML 文件中,我们将端点配置为侦听端口 10514 上的 udp 信息,请注意,在 netty 中,禁用 defaultCodec,这个
将允许回退到 NettyTypeConverter,并以 InputStream 形式提供消息:
<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<syslog id="mySyslog"/>
</dataFormats>
<route>
<from uri="netty:udp://localhost:10514?sync=false&allowDefaultCodec=false"/>
<unmarshal ref="mySyslog"/>
<to uri="mock:stop1"/>
</route>
</camelContext>
<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<syslog id="mySyslog"/>
</dataFormats>
<route>
<from uri="netty:udp://localhost:10514?sync=false&allowDefaultCodec=false"/>
<unmarshal ref="mySyslog"/>
<to uri="mock:stop1"/>
</route>
</camelContext>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<syslog id="mySyslog"/>
</dataFormats>
<route>
<from uri="mina:udp://localhost:10514"/>
<unmarshal ref="mySyslog"/>
<to uri="mock:stop1"/>
</route>
</camelContext>
<camelContext id="myCamel" xmlns="http://camel.apache.org/schema/spring">
<dataFormats>
<syslog id="mySyslog"/>
</dataFormats>
<route>
<from uri="mina:udp://localhost:10514"/>
<unmarshal ref="mySyslog"/>
<to uri="mock:stop1"/>
</route>
</camelContext>
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow