Details
-
Bug
-
Resolution: Done
-
Major
-
jboss-fuse-6.2.1
-
None
-
%
Description
I build my Camel CXF routes using Java DSL. Inside my RouteBuilder I inject another bean from registry using Camel annotation @BeanInject.
public class GreeterBuilder extends RouteBuilder { @BeanInject Configuration configuration; private CxfEndpoint endpoint; @Override public void configure() throws Exception { registerWsEndpoint(); buildRoutes(); } //public GreeterBuilder() { // this.configuration = configuration; //} public void buildRoutes() { ...
I also configure CXF http-jetty transport with reverse proxy inside blueprint context and set "forwarder=true" on org.eclipse.jetty.server.nio.SelectChannelConnector.
<blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:httpj="http://cxf.apache.org/transports/http-jetty/configuration" xsi:schemaLocation=" http://www.osgi.org/xmlns/blueprint/v1.0.0 http://www.osgi.org/xmlns/blueprint/v1.0.0/blueprint.xsd "> <httpj:engine-factory bus="cxf"> <httpj:engine port="7771"> <httpj:connector> <bean id="connector" class="org.eclipse.jetty.server.nio.SelectChannelConnector"> <property name="port" value="7771"/> <property name="forwarded" value="true"/> </bean> </httpj:connector> </httpj:engine> </httpj:engine-factory> <bean id="greeterId" class="org.jboss.fuse.samples.camelcxf.GreeterBuilder"/> <bean id="config" class="org.jboss.fuse.samples.camelcxf.config.ConfigurationImpl"/> <camelContext id="camel-demo" xmlns="http://camel.apache.org/schema/blueprint" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://camel.apache.org/schema/blueprint "> <routeBuilder ref="greeterId"/> </camelContext> </blueprint>
However, the reverse proxy won't work as long as the Camel annotation @BeanInject is present in the RouteBuilder bean.
The workaround is not to use @BeanInject annotation at all. For instance, either passing the "configuration" bean through the RouteBuilder constructor or use blueprint annotation @Inject on the "configuration" instead.
Attachments
Issue Links
- is duplicated by
-
ENTESB-7216 BlueprintCamelContext can not add an ActiveMQComponent using non-default name in RouteBuilder.configure method
- Closed
- relates to
-
CAMEL-10394 Loading...
-
CAMEL-10513 Loading...
-
CAMEL-10964 Loading...