Apache camel camel netty4 ChannelHandlerFactory ByteToMessageDecoder错误

Apache camel camel netty4 ChannelHandlerFactory ByteToMessageDecoder错误,apache-camel,Apache Camel,因为我是骆驼的初学者。我想得到一个提示来解决我的问题。 这是我的密码 完整源链接: 我的路由器是 from("netty4:tcp://localhost:8004?textline=true&sync=true&decoders=#vpaByteDecoder&encoders=#stringEncoder"). 错误被这样调用 io.netty.channel.ChannelPipelineException: config.ChannelHandlerFactor

因为我是骆驼的初学者。我想得到一个提示来解决我的问题。 这是我的密码

完整源链接:

我的路由器是

from("netty4:tcp://localhost:8004?textline=true&sync=true&decoders=#vpaByteDecoder&encoders=#stringEncoder").
错误被这样调用

io.netty.channel.ChannelPipelineException: config.ChannelHandlerFactoryDecoder$VpaByteDecoder is not a @Sharable handler, so can't be added or removed multiple times.
ByteToMessageDecoder不应共享。所以我建议使用ChannelHandlerFactory


我不知道原因。请告诉我如何理解我的问题。

应该命名为工厂类而不是bean方法,类似这样,然后删除
@bean

@Component(name="vpaByteDecoder")
public class ChannelHandlerFactoryByteArrayDecoder implements ChannelHandlerFactory {
@Component(name="vpaByteDecoder")
public class ChannelHandlerFactoryByteArrayDecoder implements ChannelHandlerFactory {