Question

New to Apache Camel and just wondering ... if I'm building an image processing application that does some long running image processing jobs on very large image files, is an Apache Camel "Processor" the "best place" for this code ? The processing may take up to 15 minutes.

http://camel.apache.org/processor.html

Cheers !

Was it helpful?

Solution

the Processor interface just provides a way to call custom Java code from a route, it can be used for anything really...you can also use Bean integration to simply call your existing POJO code w/o any changes, etc.

as for your long running process...you should run this asynchronously and setup a consumer to pickup the results when they are ready, (file consumer, etc).

OTHER TIPS

As Ben ODay says, Processor - is the way you are able to apply your code to transform/process the message (read - data). Therefore it is the right place for your task. Bean integration and Processor - it's about how you provide your code for Camel. Actually they are the same things. How about long time of processing - you should be worred if you produce a large count of messages into the route. What kind of queue do you use? And what count of messages do you produce? You should read about Seda component and its option named "concurrentConsumers". You could manage concurrent processing by using this option as well.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top