Apache camel Apache Camel netty udp使用者在没有解码器的情况下无法工作

Apache camel Apache Camel netty udp使用者在没有解码器的情况下无法工作,apache-camel,netty,Apache Camel,Netty,如果我有以下驼峰路由并发送udp消息,则不会向stdout打印任何内容: <route> <from uri="netty:udp://0.0.0.0:5000"/> <to uri="mock:stdout"/> </route> Apache page解释说: allowDefaultCodec == true Camel 2.4: The netty component installs a

如果我有以下驼峰路由并发送udp消息,则不会向stdout打印任何内容:

    <route>
        <from uri="netty:udp://0.0.0.0:5000"/>
        <to uri="mock:stdout"/>
    </route>
Apache page解释说:

allowDefaultCodec == true
Camel 2.4: The netty component installs a default codec if both,
encoder/deocder is null and textline is false. 
Setting allowDefaultCodec to false prevents the netty component from installing a 
default codec as the first element in the filter chain.

字符串解码器要求您使用新行终止字符串。因此,请确保在发送邮件时包含这些内容

例如,在javadoc和代码示例中,您可以看到它们使用\n

您是否尝试将textline设置为true?如果为false,它将尝试在消息上使用对象序列化。Camel文档说明textline仅用于TCP。我正在做UDP.Thx克劳斯,感谢你回来回答这个问题。我在udp数据包中发送json消息,然后使用jackson将json字符串解码为正确的json节点对象。因此,有效负载中已经有许多\n项。
$ cat json.txt | nc -4u -w1 hostname 5000
allowDefaultCodec == true
Camel 2.4: The netty component installs a default codec if both,
encoder/deocder is null and textline is false. 
Setting allowDefaultCodec to false prevents the netty component from installing a 
default codec as the first element in the filter chain.