A quick & simple Apache Camel example for decoupling logic between Rest controller and Service layer.
- At
/api/msg1
endpoint, we directly useservice
to fulfill request - At
/api/msg2
endpoint, we use Camel withdirect
Component for logic routing - At
/api/msg3
endpoint, we hide Camel's details with@Produce
&@Consume
annotation - At
/api/msg4
endpoint, we demo a chain of Camel routes
All the routing logic is inside DemoRouteConfig
class.
Start the application, call rest APIs to see result: