Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Camelize a spring boot application

We have a spring boot application that is growing in complexity because of integration needs - like send an email after you do this, or broadcast a jms message after you that etc. In looking for some higher level abstractions, I came across apache camel (haven't used camel ever before). The question that I have is what do I do with the spring boot application? The application has the standard spring controllers, services and uses spring-data for connecting to databases. I didn't find much help online on how to merge camel into a spring-boot restful application. Is that even something that is doable or is camel a completely different beast that the spring boot won't fit?

I did read that Camel tightly integrates with Spring, but still I didn't know if 1) Spring Controllers are still something that can be used along with Camel 2) If I can call the other spring beans from camel routes and whether I can call invoke a camel route from a spring bean (sorry if these sound like camel newbie questions to the experts)

As an example of what we have to do:

  1. After finishing writing anything to the database about an order, we have to send an email out to the order processing department
  2. If someone deletes a particular user address, we have to send to a jms topic so other applications can take action.

Every http request is coming in through the Spring MVC stack today.

Is there a way to "hand-off" the processing to camel after a particular task is complete? (like writing the order to the database successfully via the Spring MVC stack and hand off to camel to send a jms message and do other things)? Or should we completely replace Spring with Camel?

Not sure what the right path is. Can someone please guide us?

like image 626
sat Avatar asked Sep 29 '22 21:09

sat


1 Answers

This question is slightly old, but though it was worth mentioning here that Apache Camel now includes a Spring Boot component.

Details can be found here
http://camel.apache.org/spring-boot.html
and they document an example here
http://camel.apache.org/spring-boot-example.html

Follow this for the current best practice in camelising a spring boot application!

like image 58
Matthew Wells Avatar answered Oct 13 '22 01:10

Matthew Wells