It looks like you send the message to the “direct:testEndpoint” before route 
builder is loaded.
Did your test class extends the CamelTestSupport?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On August 27, 2014 at 3:54:46 AM, edmondo1984 (edmondo.po...@gmail.com) wrote:
> There might also be a wrong usage. The following code fails
>  
> @Test
> public void routeFails() throws Exception{
> =
>  
> template.sendBody("direct:testEndpoint", "Hello world");
>  
> }
>  
> protected RouteBuilder createRouteBuilder() {
> return new RouteBuilder() {
> public void configure() {
>  
> from("direct:testEndPoint").to("netty:tcp://
> www.google.com:80");
>  
> //from("netty:tcp://www.google.com:80").transform(body().regexReplaceAll("Hello",
>   
> "Bye"));
> }
> };
> }
>  
> Where am I wrong in the usage of the camel component?
>  
> at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
> at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:67)  
> Caused by:
> org.apache.camel.component.direct.DirectConsumerNotAvailableException: No  
> consumers available on endpoint: Endpoint[direct://testEndpoint].
> Exchange[Message: Hello world]
> at org.apache.camel.component.direct.DirectProducer.process(DirectProd
>  
>  
>  
> Thank you for your help
>  
> Edmondo
>  
>  
> 2014-08-26 13:28 GMT+01:00 Willem.Jiang [via Camel] <
> ml-node+s465427n5755699...@n5.nabble.com>:
>  
> > No, you cannot specify the local port when sending the request to server.
> >
> > --
> > Willem Jiang
> >
> > Red Hat, Inc.
> > Web: http://www.redhat.com
> > Blog: http://willemjiang.blogspot.com (English)
> > http://jnn.iteye.com (Chinese)
> > Twitter: willemjiang
> > Weibo: 姜宁willem
> >
> >
> >
> > On August 26, 2014 at 6:25:38 PM, edmondo1984 ([hidden email]
> > ) wrote:
> >
> > > I probably misexplained myself.
> > >
> > > I am connecting to a remote url:
> > >
> > > to ("netty:tcp://oneserver:129")
> > >
> > > This fails because the local port netty is using for the tcp connection
> > is
> > > already taken.
> > >
> > > I would need to tell netty: create a tcp connection from localhost:24563
> > to
> > > oneserver:129 for example
> > >
> > > Thank you
> > > Il 26/Ago/2014 11:17 "Claus Ibsen-2 [via Camel]" <
> > > [hidden email] >
> > ha scritto:
> > >
> > > > You set the port as part of the uri of the endpoint, etc
> > > >
> > > > netty:tcp://localhost:99999[?options]
> > > >
> > > > On Tue, Aug 26, 2014 at 12:14 PM, edmondo1984 <[hidden email]
> > > > > wrote:
> > > > > Thanks. I have read the documentation before posting and I didn't
> > find
> > > > it :(
> > > > > I suppose I am missing maybe some Netty know how?
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > View this message in context:
> > > >
> > http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755688.html
> >   
> >
> > > > > Sent from the Camel - Users mailing list archive at Nabble.com.
> > > >
> > > >
> > > >
> > > > --
> > > > Claus Ibsen
> > > > -----------------
> > > > Red Hat, Inc.
> > > > Email: [hidden email]
> > > >
> > > > Twitter: davsclaus
> > > > Blog: http://davsclaus.com
> > > > Author of Camel in Action: http://www.manning.com/ibsen
> > > > hawtio: http://hawt.io/
> > > > fabric8: http://fabric8.io/
> > > >
> > > >
> > > > ------------------------------
> > > > If you reply to this email, your message will be added to the
> > discussion
> > > > below:
> > > >
> > > >
> > http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755689.html
> >   
> >
> > > > To unsubscribe from Camel Netty component bind failure, click here
> > > >
> > > > .
> > > > NAML
> > > >
> > > >
> > >
> > >
> > >
> > >
> > > --
> > > View this message in context:
> > http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755691.html
> >   
> >
> > > Sent from the Camel - Users mailing list archive at Nabble.com.
> >
> >
> >
> > ------------------------------
> > If you reply to this email, your message will be added to the discussion
> > below:
> >
> > http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755699.html
> >   
> > To unsubscribe from Camel Netty component bind failure, click here
> >  
> > .
> > NAML
> >  
> >
>  
>  
>  
>  
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Camel-Netty-component-bind-failure-tp5755683p5755728.html
>   
> Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to