camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim <che...@gmail.com>
Subject Re: Camel Routes startup error
Date Wed, 06 Apr 2011 16:20:16 GMT
I've had similar problems before and had to use @DependsOn which is a
spring provided annotation to wait on the initialization of camel
before sending message to a route.

On Wed, Apr 6, 2011 at 10:59 AM, lone squirrely
<thelonesquirrely@gmail.com> wrote:
> Hello!
>
> I am writing an application (camel + spring) that will send a protobuf
> message to an already running activeMq instance - and it seems to be
> working.  But the problem is that the routes don't seem to have
> started yet...
>
> the error i am getting is about there being no consumers on the endpoint:
>
> "No consumers available on endpoint: Endpoint[direct://proto.tg]"
>
> and the route builder does this:
>  from ("direct://proto.tg").
>      marshal().protobuf (somProto.getDefaultInstance ()).
>      to ("activemq:query").
>      unmarshal ().protobuf (someOtherProto.getDefaultInstance());
>
> When I ask to route a message in my code:
>      ProducerTemplate pt = camelContext.createProducerTemplate ();
>      ret = (T)pt.sendBody ("direct://proto.tg",  ExchangePattern.InOut, msg);
>
> It will work after the context has finished initialization...but if I
> ask before (because it is part of an init...of a bean) i get the above
> problem.
>
> my spring init looks like this:
>
>  <context:property-placeholder location="classpath:properties/*.properties" />
>
>  <bean id="activemq"
> class="org.apache.activemq.camel.component.ActiveMQComponent">
>    <property name="brokerURL"
> value="tcp://${broker.property...}:${broker.port}" />
>  </bean>
>
>  <camel:camelContext id="camelContext">
>    <camel:package>nrf.mars.camel</camel:package>
>  </camel:camelContext>
>
> Any input is good! Thanks!
>

Mime
View raw message