Hi I added an test and a improvement for Camel 2.11 http://svn.apache.org/r1447882
There is a bit more work to do as you need to configure the timer on the endpoint as well start components / endpoints etc. On Tue, Feb 19, 2013 at 8:06 PM, Claus Ibsen <[email protected]> wrote: > On Thu, Feb 14, 2013 at 9:09 PM, Tyler Durvik <[email protected]> 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 > > Yeah most of the endpoints has a default no-arg constructor. > Though not all of them has. Also a vast majority of users use the > components / endpoints using the DSL. > Or grab the endpoint by an uri / part of the uri. And then configure it. > > In your case the NettyEndpoint would be needed to be enhanced with the > no-arg ctr. > Let me see if we can get that in the code base. > > > > > -- > Claus Ibsen > ----------------- > Red Hat, Inc. > FuseSource is now part of Red Hat > Email: [email protected] > Web: http://fusesource.com > Twitter: davsclaus > Blog: http://davsclaus.com > Author of Camel in Action: http://www.manning.com/ibsen -- Claus Ibsen ----------------- Red Hat, Inc. FuseSource is now part of Red Hat Email: [email protected] Web: http://fusesource.com Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
