You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by lone squirrely <th...@gmail.com> on 2011/04/06 17:59:24 UTC
Camel Routes startup error
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!
Re: Camel Routes startup error
Posted by Tim <ch...@gmail.com>.
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
<th...@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!
>