On 11/16/10 5:04 AM, serega wrote:

Hi.
I've tried examples from here
http://camel.apache.org/spring-testing.html

Two questions:
1.  is how do I specify the producer template in spring?
I've tried the following line
  <template id="test" defaultEndpoint="direct:start"/>
I got org.apache.camel.NoSuchEndpointException: No endpoint could be found
for: ref:direct:start
Can I have a look at your camel route?
If there is no consumer of the direct:start, the Exception is making sense. Please make sure you have the

2. How to I write the following

@Produce(uri = "direct:start")
protected ProducerTemplate template;

without annotations?
You can get the prodoucerTemplate from camelContext even you didn't define it in the spring. Camel will register it automatically.

ProducerTemplate producerTemplate = context.getRegistry().lookup("template", ProducerTemplate.class);

Then you can use the template to send the message to the endpoint that you want.

Thanks,

Sergey.


--
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
         http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Reply via email to