...
Info |
---|
|
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. |
Div |
---|
class | confluenceTableSmall |
---|
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Name || Default Value || Description ||
| {{chunkedMaxContentLength}} | {{1mb}} | Value in bytes the max content length per chunked frame received on the Netty HTTP server. |
| {{compression}} | {{false}} | Allow using gzip/deflate for compression on the Netty HTTP server if the client supports it from the HTTP headers. |
| {{headerFilterStrategy}} | | To use a custom {{ Name | Default Value | Description |
---|
chunkedMaxContentLength | 1mb | Value in bytes the max content length per chunked frame received on the Netty HTTP server. | compression | false | Allow using gzip/deflate for compression on the Netty HTTP server if the client supports it from the HTTP headers. | headerFilterStrategy | | To use a custom |
org.apache.camel.spi.HeaderFilterStrategy
|
}} |
| {{httpMethodRestrict}} | | To disable HTTP methods on the Netty HTTP consumer. You can specify multiple separated by comma. |
| {{mapHeaders}} | {{true}} | If this option is enabled, then during binding from Netty to Camel [Message] then the headers will be mapped as well (eg added as header to the Camel [Message] as well). You can turn off this option to disable this. The headers can still be accessed from the {{ | httpMethodRestrict | | To disable HTTP methods on the Netty HTTP consumer. You can specify multiple separated by comma. | mapHeaders | true | If this option is enabled, then during binding from Netty to Camel Message then the headers will be mapped as well (eg added as header to the Camel Message as well). You can turn off this option to disable this. The headers can still be accessed from the org.apache.camel.component.netty.http.NettyHttpMessage |
}} {{}} {{org.jboss.netty.handler.codec.http.HttpRequest
|
}} |
| {{matchOnUriPrefix}} | {{false}} | Whether or not Camel should try to find a target consumer by matching the URI prefix if no exact match is found. See further below for more details. |
| {{nettyHttpBinding}} | | To use a custom {{ | matchOnUriPrefix | false | Whether or not Camel should try to find a target consumer by matching the URI prefix if no exact match is found. See further below for more details. | nettyHttpBinding | | To use a custom org.apache.camel.component.netty.http.NettyHttpBinding |
}} |
| {{bridgeEndpoint}} | {{false}} | If the option is {{true}}, the producer will ignore the {{ | bridgeEndpoint | false | If the option is true , the producer will ignore the Exchange.HTTP_URI |
}} {{}} {{}} |
| {{throwExceptionOnFailure}} | {{true}} | Option to disable throwing the {{HttpOperationFailedException}} in case of failed responses from the remote server. This allows you to get all responses regardles of the HTTP status code. |
| {{traceEnabled}} | {{false}} | Specifies whether to enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off. |
| {{transferException}} | {{false}} | If enabled and an [Exchange] failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a {{ | throwExceptionOnFailure | true | Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardles of the HTTP status code. | traceEnabled | false | Specifies whether to enable HTTP TRACE for this Netty HTTP consumer. By default TRACE is turned off. | transferException | false | If enabled and an Exchange failed processing on the consumer side, and if the caused Exception was send back serialized in the response as a application/x-java-serialized-object |
}} {{HttpOperationFailedException
|
}} |
| {{urlDecodeHeaders}} | | If this option is enabled, then during binding from Netty to Camel [Message] then the header values will be URL decoded (eg %20 will be a space character. Notice this option is used by the default {{ | urlDecodeHeaders | | If this option is enabled, then during binding from Netty to Camel Message then the header values will be URL decoded (eg %20 will be a space character. Notice this option is used by the default org.apache.camel.component.netty.http.NettyHttpBinding |
}} {{org.apache.camel.component.netty.http.NettyHttpBinding
|
}} ** {{}} {{}} |
| {{nettySharedHttpServer}} | {{null}} | To use a shared [Netty HTTP] server. See [Netty HTTP Server Example] for more details. |
| {{disableStreamCache}} | {{false}} | Determines whether or not the raw input stream from Netty {{HttpRequest#getContent()}} is cached or not (Camel will read the stream into a in light-weight memory based Stream caching) cache. By default Camel will cache the Netty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to {{true}} when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. Mind that if you enable this option, then you cannot read the Netty stream multiple times out of the box, and you would need manually to reset the reader index on the Netty raw stream. |
| {{securityConfiguration}} | {{null}} | *Consumer only*. Refers to a {{ | nettySharedHttpServer | null | To use a shared Netty HTTP server. See Netty HTTP Server Example for more details. | disableStreamCache | false | Determines whether or not the raw input stream from Netty HttpRequest#getContent() is cached or not (Camel will read the stream into a in light-weight memory based Stream caching) cache. By default Camel will cache the Netty input stream to support reading it multiple times to ensure it Camel can retrieve all data from the stream. However you can set this option to true when you for example need to access the raw stream, such as streaming it directly to a file or other persistent store. Mind that if you enable this option, then you cannot read the Netty stream multiple times out of the box, and you would need manually to reset the reader index on the Netty raw stream. | securityConfiguration | null | Consumer only. Refers to a org.apache.camel.component.netty.http.NettyHttpSecurityConfiguration |
}} |
| {{send503whenSuspended}} | {{true}} | *Consumer only*. Whether to send back HTTP status code 503 when the consumer has been suspended. If the option is {{false}} then the Netty Acceptor is unbound when the consumer is suspended, so clients cannot connect anymore. |
{div} | send503whenSuspended | true | Consumer only. Whether to send back HTTP status code 503 when the consumer has been suspended. If the option is false then the Netty Acceptor is unbound when the consumer is suspended, so clients cannot connect anymore. |
|
The NettyHttpSecurityConfiguration
has the following options:
Div |
---|
class | confluenceTableSmall |
---|
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Name || Default Value || Description ||
| {{authenticate}} | {{true}} | Whether authentication is enabled. Can be used to quickly turn this off. |
| {{constraint}} | {{Basic}} | The constraint supported. Currently only {{Basic}} is implemented and supported. |
| {{realm}} | {{null}} | The name of the JAAS security realm. This option is mandatory. |
| {{securityConstraint}} | {{null}} | Allows to plugin a security constraint mapper where you can define ACL to web resources. |
| {{securityAuthenticator}} | {{null}} | Allows to plugin a authenticator that performs the authentication. If none has been configured then the {{ Name | Default Value | Description |
---|
authenticate | true | Whether authentication is enabled. Can be used to quickly turn this off. | constraint | Basic | The constraint supported. Currently only Basic is implemented and supported. | realm | null | The name of the JAAS security realm. This option is mandatory. | securityConstraint | null | Allows to plugin a security constraint mapper where you can define ACL to web resources. | securityAuthenticator | null | Allows to plugin a authenticator that performs the authentication. If none has been configured then the |
org.apache.camel.component.netty.http.JAASSecurityAuthenticator
|
}} |
| {{loginDeniedLoggingLevel}} | {{DEBUG}} | Logging level used when a login attempt failed, which allows to see more details why the login failed. |
| {{roleClassName}} | {{null}} | To specify FQN class names of {{Principal}} implementations that contains user roles. If none has been specified, then the [Netty HTTP] component will by default assume a {{Principal}} is role based if its FQN classname has the lower-case word {{role}} in its classname. You can specify multiple class names separated by comma. |
{div} | loginDeniedLoggingLevel | DEBUG | Logging level used when a login attempt failed, which allows to see more details why the login failed. | roleClassName | null | To specify FQN class names of Principal implementations that contains user roles. If none has been specified, then the Netty HTTP component will by default assume a Principal is role based if its FQN classname has the lower-case word role in its classname. You can specify multiple class names separated by comma. |
|
The following headers can be used on the producer to control the HTTP request.
Div |
---|
class | confluenceTableSmall |
---|
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Name || Type || Description ||
| {{CamelHttpMethod}} | {{String}} | Allow to control what HTTP method to use such as GET, POST, TRACE etc. The type can also be a {{ Name | Type | Description |
---|
CamelHttpMethod | String | Allow to control what HTTP method to use such as GET, POST, TRACE etc. The type can also be a |
org.jboss.netty.handler.codec.http.HttpMethod
|
}} |
| {{CamelHttpQuery}} | {{String}} | Allows to provide URI query parameters as a {{String}} value that overrides the endpoint configuration. Separate multiple parameters using the & sign. For example: {{ | CamelHttpQuery | String | Allows to provide URI query parameters as a String value that overrides the endpoint configuration. Separate multiple parameters using the & sign. For example: foo=bar&beer=yes |
}}. |
| {{CamelHttpPath}} | {{String}} | *Camel . | CamelHttpPath | String | Camel 2.13.1/2.12.4: |
* {{}} |
| {{}} | {{String}} | To set the | String | To set the content-type |
{{ }} |
{div} |
The following headers is provided as meta-data when a route starts from an Netty HTTP endpoint:
The description in the table takes offset in a route having: from("netty-http:http:0.0.0.0:8080/myapp")...
Div |
---|
class | confluenceTableSmall |
---|
|
Wiki Markup |
---|
{div:class=confluenceTableSmall}
|| Name || Type || Description ||
| {{CamelHttpMethod}} | {{String}} | The HTTP method used, such as GET, POST, TRACE etc. |
| {{CamelHttpUrl}} | {{String}} | The URL including protocol, host and port, etc: {code} Name | Type | Description |
---|
CamelHttpMethod | String | The HTTP method used, such as GET, POST, TRACE etc. | CamelHttpUrl | String | The URL including protocol, host and port, etc: |
http://0.0.0.0:8080/myapp |
|
{code} |
| {{CamelHttpUri}} | {{String}} | The URI without protocol, host and port, etc: {code}/myapp{code} |
| {{CamelHttpQuery}} | {{String}} | Any query parameters, such as {{ | CamelHttpUri | String | The URI without protocol, host and port, etc: | CamelHttpQuery | String | Any query parameters, such as foo=bar&beer=yes |
}} |
| {{CamelHttpRawQuery}} | {{String}} | *Camel | CamelHttpRawQuery | String | Camel 2.13.0 |
* {{}} |
| {{CamelHttpPath}} | {{String}} | Additional | CamelHttpPath | String | Additional context-path. |
{{}} {{}} {{}} |
| {{CamelHttpCharacterEncoding}} | {{String}} | The charset from the | CamelHttpCharacterEncoding | String | The charset from the content-type |
|
| {{CamelHttpAuthentication}} | {{String}} | If the user was authenticated using HTTP Basic then this header is added with the value {{Basic}}. |
| {{Content-Type}} | {{String}} | The content type if provided. For example: {{text/plain; | CamelHttpAuthentication | String | If the user was authenticated using HTTP Basic then this header is added with the value Basic . | Content-Type | String | The content type if provided. For example: text/plain; charset="UTF-8" |
}} |
{div} |
Access to Netty types
This component uses the org.apache.camel.component.netty.http.NettyHttpMessage
as the message implementation on the Exchange. This allows end users to get access to the original Netty request/response instances if needed, as shown below:
...