Camel usually use the URI to configure the endpoint instance, so you need to 
pass the URI to the endpoint instance. We also use the URI as the key to cache 
the producer or consumer which are created from the endpoint.

I'm not sure why you don't want to use the URI directly, but you can pass the 
URI with netty://tcp:xxx to the construction of NettyEndpoint.  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) 
(English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Friday, February 15, 2013 at 4:09 AM, Tyler Durvik wrote:

> I would like to create a NettyEndpoint with a specified
> NettyConfiguration, but cannot find an example on how to do this.
>  
> So I have the following:
>  
> public class MyDataRoute extends RouteBuilder {
>  
> @Override
> public void configure() throws Exception {
>  
> // set up my decoders/encoders
>  
> NettyConfiguration nettyConfig = new NettyConfiguration();
> nettyConfig.setProtocol("tcp");
> nettyConfig.setDecoders(decoders);
> nettyConfig.setEncoders(encoders);
> nettyConfig.setHost(remoteHost);
> nettyConfig.setPort(remotePort);
> nettyConfig.setSendBufferSize(sendBufferSize);
> nettyConfig.setReceiveBufferSize(recvBufferSize);
> nettyConfig.setSync(false);
>  
> NettyComponent component = new NettyComponent( getContext() );
> component.setConfiguration(nettyConfig);
>  
> // WHAT GOES IN THE FIRST PARAMETER ???
> NettyEndpoint endpoint = new NettyEndpoint("", component, nettyConfig);
>  
>  
> I see that the NettyEndpoint contructor takes a URI as an argument. I
> am trying to build the "netty:tcp...." stuff using the
> NettyConfiguration instance so I am not sure why I need the URI
> parameter. Any help would be appreciated.
>  
> Thank you  


Reply via email to