Jetty Component
The jetty: component provides HTTP based endpoints for consuming HTTP requests that arrive at an http endpoint.
URI format
jetty:http:hostname[:port][/resourceUri][?options]
Options
Name |
Description |
Example |
Required? |
default value |
---|---|---|---|---|
sessionSupport |
The option for enable the session manager in the server side of Jetty. |
sessionSupport=true |
No |
false |
Usage
You can only consume from endpoints generated by the Jetty component. Therefore it should only be used as input into your camel Routes. To issue HTTP requests against other HTTP endpoints you can use the HTTP Component
Sample
In this sample we define a route where we expose a http service at http://localhost:8080/myapp/myservice
:
Our business logic is implemented in our MyBookService class where we can access the http request stuff and return a response.
Note: The assert is because the code is part of an unit test.