3

I am investigating Camel for connecting various services. I understand the core concepts but I was curious about more specific implementation details. This application would have a browser client front-end that communicates using Ajax REST calls into the ESB.

Imagine that the end user sends personal information and credit card information to the ESB to register for car insurance. All the information is sent and the ESB should return with a result that the application was processed. The different routes along the bus would include, verifying personal information and then processing the credit card information and then storing that data in a database and then returning with a success. So, let's imagine that there is service1-personal, service2-creditcard, and service-3-database. Between those points, I would like to send a asynchronous message using Camel and MQ/Queue and the service1 can consume the message and the service2 will consume the result of that message, etc.

I have two questions and one of them is the important one.

How should browser initiate the message and send the initial application data? Should it just post it as a form/REST? And then, should the client wait asynchronously and poll for the result? Check the last message from service3 with the result of the application? Or could it be done synchronously? What is the best approach? Should websockets be used and the ESB can send a response once the application is complete?

Also, does anyone have more granular details on the best approach for doing this with camel. For example, do you know what routes or EIP type to use as I describe here? Do you know what the camel XML config would look like? Say with using Camel MQ/Spring DSL?

1
  • You could use a REST endpoint in Camel to consume the request. Or, it could be a Web-Service. You could then transform the request into the appropriate inputs for the various services, and call them -- in parallel if there are no dependencies. Then, aggregate the result in some way and return it to the caller. – Darius X. Mar 18 '17 at 3:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.