Hi guys,

I just followed this example
(http://camel.apache.org/netty-http-server-example.html) and successfully
deployed a shared netty http server to apache karaf. But I could not figure
out how to reference this shared netty http server in my Rest Java DSL route
file. Here is my route file:

import javax.inject.Inject;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
import org.apache.camel.component.netty4.http.NettySharedHttpServer;
import org.ops4j.pax.cdi.api.OsgiService;

@ContextName("sample")
public class SampleRoute extends RouteBuilder {

  @Inject @OsgiService
  private NettySharedHttpServer server;

  @Override
  public void configure() {
   
restConfiguration().component("netty4-http").endpointProperty("nettySharedHttpServer",
"#WHAT_IS_THIS_ID");
    rest("/say").get("/hello").to("mock:hello");
  }

}

I wonder to know if I inject netty shared http server into my route file
like above sample code instead of using OSGi blueprint, what is the id of
netty shared http server? Must I use blueprint xml configuration file? Could
someone shed some light on this please? Thanks in advance!

Leon



--
View this message in context: 
http://camel.465427.n5.nabble.com/How-to-use-cdi-annotation-to-reference-shared-netty-server-in-karaf-tp5782250.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to