Netty HTTP Component
Available as of Camel 2.12
The netty-http component is an extension to Netty component to facilitiate HTTP transport with Netty.
This camel component supports both producer and consumer endpoints.
Stream
Netty 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 data multiple times (eg: 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.
Maven users will need to add the following dependency to their pom.xml
for this component:
<dependency> <groupId>org.apache.camel</groupId> <artifactId>camel-netty-http</artifactId> <version>x.x.x</version> <!-- use the same version as your Camel core version --> </dependency>
URI format
The URI scheme for a netty component is as follows
netty-http:http://localhost:8080[?options]
You can append query options to the URI in the following format, ?option=value&option=value&...
HTTP Options
Important: This component inherits all the options from Netty. So make sure to look at the Netty documentation as well.
Notice that some options from Netty is not applicable when using this Netty HTTP component, such as options related to UDP transport.
Name |
Default Value |
Description |
---|---|---|
|
|
Allow using chunked transfer if the client supports it from the HTTP headers. |
|
|
Allow using gzip/deflate for compression if the client supports it from the HTTP headers. |
|
|
To use a custom |
|
|
To use a custom |
|
|
Specifies whether to enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off. |
|
|
To disable HTTP methods on the Netty HTTP consumer. You can specify multiple separated by comma. |