3

I am very new to EIP and ApacheCamel and need some help from the experts. The question is basically about the best way to retrieve data from system B that system A requires using ApacheCamel. For example: System B has MultiplyService. System A needs to use that Service via ApacheCamel. ApacheCamel receives the request from System A, pass it to system B (somehow), wait for the response then pass it back to system A. So far the example I found online assumes the MultiplyService lives in ApacheCamel itself:

from("jms:queue:numbers").to("multiplier");

Thanks in advance.

Stephane Nicoll
  • 31,977
  • 9
  • 97
  • 89
zoro74
  • 171
  • 15
  • There is no best way but most suitable way. You must decide kind of endpoint(generic or specific) that you want to use. Within same camel context - direct, seda. Within same jvm - vm. Within same network - jms, http, tcp. There are a lot of possibilities. So, please give more specific requirement. – hutingung Aug 12 '14 at 16:12
  • Thanks for the reply hutingung, here are my answers: endpoint => generic (other systems can use it via ApacheCamel). Same Camel Context - direct. Not necessarily same JVM. Within same network - JMS. – zoro74 Aug 12 '14 at 21:57

1 Answers1

1

there are a lot of options, in general I would wrap any services that need to be exposed to other applications with HTTP (jetty), REST (cxfrs), SOAP (cxfws) or JMS (AMQ request/reply)...

define this in system B...

from("jetty://localhost:9001/multiplier).process(new MyMultiplierService());

and invoke it from system A like this...

from("jms:queue:numbers").to("jetty://localhost:9001/multiplier");
Ben ODay
  • 20,784
  • 9
  • 45
  • 68
  • Thanks boday, I was thinking of wrapping the service with JMS/REST and create a processor in Camel that connects to it (System B). I am not sure about your suggestion "**define this in system B**" would work as System B doesn't use Camel. – zoro74 Aug 12 '14 at 22:07
  • how does System B expose the MultiplyService? – Ben ODay Aug 12 '14 at 22:50
  • Thanks boday.. I've done more reading and now I understand how it works little bit better. **Polling Consumer** can be used with your example above. – zoro74 Aug 14 '14 at 12:52