Hello All,
I am trying to use the pollingConsumer. You need to inject the
consumerTemplate into your bean. I figured that since consumerTemplate
is defined within the camel context, I need to define my bean within the
context.
When I do this, I can't reference this bean using bean ref... . Any
ideas?
Thanks
<camel:camelContext xmlns="http://camel.apache.org/schema/spring"
>
<camel:consumerTemplate id="consumerTemplate" />
<camel:route id="autoexec-messageHandler">
<camel:from uri="timer://start?repeatCount=1"/>
<camel:bean
beanType="com.cs.algo.autoexecution.camelinterface.ConsumerTemplateBean"
method="setConsumer(${ref:consumerTemplate})"
id="thisConsumer" />
<camel:bean ref="thisConsumer">
</camel:route>
</camel:camelContext>
09:32:10 [main] INFO com.cs.algo.autoexecution.AutoExecutionMain -
Starting AutoExecution...
09:32:10 [main] INFO com.cs.algo.autoexecution.AutoExecutionMain -
Spring context initialized.
09:32:10 [main] INFO com.cs.algo.autoexecution.AutoExecutionMain -
Starting Camel...
[main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.11.0
starting
09:32:14 [main] INFO
com.cs.algo.autoexecution.camelinterface.MessageFactory - Setting up
login request algoautoexec
[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
2.11.0 (CamelContext: camel-1) is starting
[main] INFO org.apache.camel.management.ManagementStrategyFactory - JMX
enabled.
[main] INFO org.apache.camel.impl.converter.DefaultTypeConverter -
Loaded 177 type converters
[main] WARN org.apache.camel.util.ObjectHelper - Cannot find class:
thisConsumer
[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
2.11.0 (CamelContext: camel-1) is shutting down
[main] INFO org.apache.camel.spring.SpringCamelContext - Uptime 0.902
seconds
[main] INFO org.apache.camel.spring.SpringCamelContext - Apache Camel
2.11.0 (CamelContext: camel-1) is shutdown in 0.002 seconds
[main] INFO org.apache.camel.main.MainSupport - Apache Camel 2.11.0
stopping
09:32:16 [main] ERROR com.cs.algo.autoexecution.AutoExecutionMain -
org.apache.camel.RuntimeCamelException:
org.apache.camel.FailedToCreateRouteException: Failed to create route
autoexec-messageHandler at: >>> Bean[ref:thisConsumer] <<< in route:
Route(autoexec-messageHandler)[[From[timer://start?repeatCou... because
of No bean could be found in the registry for: thisConsumer
Geoffrey A Gershaw
CREDIT SUISSE
Information Technology | Credit eTrading Development, KFVB 525
7033 Louis Stephens Drive | 27560 Research Triangle Park | United States
Phone +1 919 994 6412
[email protected] | www.credit-suisse.com
<http://www.credit-suisse.com/>
===============================================================================
Please access the attached hyperlink for an important electronic communications
disclaimer:
http://www.credit-suisse.com/legal/en/disclaimer_email_ib.html
===============================================================================