Hi,
Current <camel:proxy> is not support to be defined out side of the
camelContext. as we set the implicit camelContext into the
CamelProxyFactoryBean when parsing the proxy element.
If you want to use it outside the camelContext , you need to specify the
camelContext property yourself. To avoid the user forget to specify the
camelContext, we just let the proxy parser visible inside of the
camelContext.
Willem
Hendy Irawan wrote:
The following works:
<camelContext xmlns="http://camel.apache.org/schema/spring">
<packageScan>
<package>com.soluvas.samples.eventfx.camel</package>
</packageScan>
<camel:proxy id="sensorEventListener"
serviceUrl="seda:Sensor.SensorEvent"
serviceInterface="com.soluvas.samples.eventfx.camel.Listener" />
</camelContext>
but this doesn't work:
<bean class="com.soluvas.samples.eventfx.camel.Sensor">
<property name="sensorListener">
<camel:proxy serviceUrl="seda:Sensor.SensorEvent"
serviceInterface="com.soluvas.samples.eventfx.camel.Listener" />
</property>
</bean>
and I have to do this:
<bean class="com.soluvas.samples.eventfx.camel.Sensor">
<property name="sensorListener">
<bean
class="org.apache.camel.spring.remoting.CamelProxyFactoryBean">
<property name="serviceUrl"
value="seda:Sensor.SensorEvent"/>
<property name="serviceInterface"
value="com.soluvas.samples.eventfx.camel.Listener"/>
</bean>
</property>
</bean>
It's too bad, because `camel:proxy` is very useful and makes Spring Remoting
- Camel concise and readable.
Is it intentional or is there plans to make camel:proxy works everywhere
(even nested inside 'property')?