Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

So why do you want to use synchronous Request Only. ? Well if you want to know whether the message was processed sucessfully successfully or not before continuing. With synchronous it allows you to wait while the message is being processed. In case the processing was succesful the control is returned to the client with no notion of error. In case of failure the client can detect this as an exception is thrown. (and exchange.isFailed() returns true).

...

Notice: As Camel always returns a Future handle for Async messaging to the client. The client can then use this handler or not to get hold of the status of the processing whether the task is complete or an Exception occured during processing.

Tip
Knowing if an Asynchronous Request Only failed
Knowing if an Asynchronous Request Only failed

In case you want to know whether the Async Request Only failed, then you can use the Future handle and invoke get() and if it throws a ExecutionException then the processing failed. The caused exception is wrapped. You can invoke isDone() first to test whether the task is done or still in progress. Otherwise invoking get() will wait until the task is done.

With these diagrams in mind lets turn out attention to the Async API and how to use it with Camel.

...