One-way route waiting on a request-response endpoint

Assume that you have a route that uses the InOnly Message Exchange Pattern (MEP). The consumer that fed a message into the route expects no response. Any endpoint listed in the route will, as a consequence, be invoked with the InOnly MEP.

This recipe shows how you can alter the MEP temporarily to InOut in order to request a response from an endpoint used in a one-way route.

Getting ready

The Java code for this recipe is located in the org.camelcookbook.routing.changingmep package. The Spring XML files are located under src/main/resources/META-INF/spring and prefixed with changingMep.

How to do it...

Use the inOut DSL statement to explicitly route a message to that endpoint with that specific MEP. ...

Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.