Versions Compared

Key

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

...

The jetty component provides HTTP-based endpoints for consuming and producing HTTP requests. That is, the Jetty component behaves as a simple Web server. Jetty can also be used as an HTTP client which mean you can also use it with Camel as a producer.

Info
titleStream

The assert call appears in this example, because the code is part of an unit test. Jetty is stream based, which means the input it receives is submitted to Camel as a stream. That means you will only be able to read the content of the stream once.

If you find a situation where the message body appears to be empty or you need to access the Exchange.HTTP_RESPONSE_CODE data multiple times, e.g., doing multicasting, or redelivery error handling, you should use Stream caching or convert the message body to a String which is safe to be re-read multiple times.

...