Parallel processing response, service integration, using Spring Boot, Apache Camel and WebTestClient
This project demonstrates how to merge results after asynchronous calls to multiple services using Apache Camel splitter technique. As a mock service, we will be calling the Internet Chuck Norris Database twice, in parallel and merging the jokes data responses into one result.
http://localhost:8080/chucknorrisjokessplitter/api/v1/api-doc Import into PostMan for further information
Sample request:
{"firstName":"Tom","lastName":"Hanks"}
POST to http://localhost:8080/chucknorrisjokessplitter/api/v1/chucknoriss/jokes
For single response POST to http://localhost:8080/chucknorrisjokessplitter/api/v1/chucknoriss/jokes
Sample response:
[{"type":"success","value":{"id":438,"joke":"Tom Hanks likes his ice like he likes his skulls: crushed.","categories":[]}},{"type":"success","value":{"id":132,"joke":"An anagram for Walker Texas Ranger is KARATE WRANGLER SEX. I don't know what that is, but it sounds AWESOME.","categories":[]}}]
WebTestClient is used to test the API
For further reference, please consider the following sections:
- The Technique of Data Flow Diagramming
- Sequencer
- Aggregator
- pache-camel-how-to-send-two-http-requests-in-parallel-and-wait-for-the-respons
- Apache Camel with Spring Boot
- Chuck Noriss Jokes API
- Maarteen Smeets
- Official Apache Maven documentation
- Spring Boot Maven Plugin Reference Guide
- Spring Boot DevTools
- Spring Integration
The following guides illustrate how to use some features concretely: