Skip to main content

Posts

Showing posts with the label endpoints

How to inject multiple endpoint in SEI using Camel's @EndpointInject

By default you can inject annotation on single method of an interface like: public interface MyListener {   @EndpointInject(uri="activemq:foo.bar")     String sayHello(String name); } what if you need multiple methods like this with @EndpointInjection happening over them for each endpoint e.g.: public interface MyListener {   @EndpointInject(uri="direct:foo")     String sayHelloFoo(String name); @EndpointInject(uri="direct:bar")     String sayHelloBar(String name); } The simple solution i have working involved spring's FactoryBean implementation. It need following steps: <!-- Define route for which you need injection to happen --> <bean id="r" class="MyListener" /> <!-- Define producer template having that route  -->   <camelContext  xmlns="http://camel.apache.org/schema/spring">         <template id="producerTemp...

CXF-RS Hiding JAXRS Service Endpoints Listing

You may come across a scenario where you want to stop listing of the exposed service from given endpoint. This can be achieved by setting the property " org.apache.cxf.endpoint.private "   to true as shown in following snippet: < jaxrs:server id = "serivceId" address = "/test" > . . . < jaxrs:properties > < entry key = "org.apache.cxf.endpoint.private" value = "true" /> </ jaxrs:properties > </ jaxrs:server > This will stop the listing of the service when url http://server:port/ test is typed in the browser.