I am not able to connect to camel route having a SEDA queue. On sever side I have following configuration:
<camel:route>
<camel:from uri="seda:input"/>
<camel:log message =">>>>>data is : ${body}"/>
<camel:inOnly uri="activemq:queue:TESTQUEUE"/>
</camel:route>
I am trying to hit this route from a standalone client like this:
public static void main(String[] args) {
CamelContext context = new DefaultCamelContext();
producer = context.createProducerTemplate();
producer.sendBody("seda:input","Hey");
}
But my producer is not able to connect to the seda queue.
Not able to hit queue of my route. Not able to add camelContext in my bean property. I am getting “Invalid property ‘camelContext’ of bean class”. If I am sending the body to SEDA queue, message is going there but not to the next element of the rout
As Petter suggested, your client needs to connect to the same Camel Context which the SEDA route is defined in. In your example, it appears that you are creating a new DefaultCamelContext() and trying to send a message through to the route that is defined in another context.
Generally, I define the Camel Context in Spring XML and then inject the context into any classes that need it…
Then, your client code would simply need to call the following…
That said, if your client code is not in the same JVM or not able to get a handle to the same CamelContext, then your options are to use JMS, REST, HTTP (or any camel component that support remote client interfaces)…instead of or around the SEDA endpoint.
For example, you could wrap access to your SEDA queue with an HTTP endpoint (via camel-jetty) like this…