--- apiVersion: v1 kind: List items: - apiVersion: v1 kind: ConfigMap metadata: labels: funktion.fabric8.io/kind: Connector provider: fabric8 project: connector-jetty version: 1.1.23 group: io.fabric8.funktion.connector name: jetty data: deployment.yml: | --- apiVersion: extensions/v1beta1 kind: Deployment metadata: labels: funktion.fabric8.io/kind: Subscription connector: jetty spec: replicas: 1 template: metadata: labels: funktion.fabric8.io/kind: Subscription connector: jetty spec: containers: - image: fabric8/connector-jetty:1.1.23 name: connector schema.yml: | --- component: kind: component scheme: jetty extendsScheme: http syntax: jetty:httpUri title: Jetty 9 description: The jetty component provides HTTP-based endpoints for consuming and producing HTTP requests. label: http deprecated: false async: true lenientProperties: true javaType: org.apache.camel.component.jetty9.JettyHttpComponent9 groupId: org.apache.camel artifactId: camel-jetty9 version: 2.18.1 componentProperties: sslKeyPassword: kind: property required: false type: string javaType: java.lang.String deprecated: false secret: false description: The key password which is used to access the certificate's key entry in the keystore (this is the same password that is supplied to the keystore command's -keypass option). sslPassword: kind: property required: false type: string javaType: java.lang.String deprecated: false secret: false description: The ssl password which is required to access the keystore file (this is the same password that is supplied to the keystore command's -storepass option). keystore: kind: property required: false type: string javaType: java.lang.String deprecated: false secret: false description: Specifies the location of the Java keystore file which contains the Jetty server's own X.509 certificate in a key entry. errorHandler: kind: property required: false type: object javaType: org.eclipse.jetty.server.handler.ErrorHandler deprecated: false secret: false description: This option is used to set the ErrorHandler that Jetty server uses. sslSocketConnectors: kind: property required: false type: object javaType: java.util.Map deprecated: false secret: false description: A map which contains per port number specific SSL connectors. socketConnectors: kind: property required: false type: object javaType: java.util.Map deprecated: false secret: false description: A map which contains per port number specific HTTP connectors. Uses the same principle as sslSocketConnectors. httpClientMinThreads: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: To set a value for minimum number of threads in HttpClient thread pool. Notice that both a min and max size must be configured. httpClientMaxThreads: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: To set a value for maximum number of threads in HttpClient thread pool. Notice that both a min and max size must be configured. minThreads: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: To set a value for minimum number of threads in server thread pool. Notice that both a min and max size must be configured. maxThreads: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: To set a value for maximum number of threads in server thread pool. Notice that both a min and max size must be configured. threadPool: kind: property required: false type: object javaType: org.eclipse.jetty.util.thread.ThreadPool deprecated: false secret: false description: To use a custom thread pool for the server. This option should only be used in special circumstances. enableJmx: kind: property required: false type: boolean javaType: boolean deprecated: false secret: false description: If this option is true Jetty JMX support will be enabled for this endpoint. jettyHttpBinding: kind: property required: false type: object javaType: org.apache.camel.component.jetty.JettyHttpBinding deprecated: false secret: false description: To use a custom org.apache.camel.component.jetty.JettyHttpBinding which are used to customize how a response should be written for the producer. httpBinding: kind: property required: false type: object javaType: org.apache.camel.http.common.HttpBinding deprecated: false secret: false description: Not to be used - use JettyHttpBinding instead. httpConfiguration: kind: property required: false type: object javaType: org.apache.camel.http.common.HttpConfiguration deprecated: false secret: false description: Jetty component does not use HttpConfiguration. mbContainer: kind: property required: false type: object javaType: org.eclipse.jetty.jmx.MBeanContainer deprecated: false secret: false description: To use a existing configured org.eclipse.jetty.jmx.MBeanContainer if JMX is enabled that Jetty uses for registering mbeans. sslSocketConnectorProperties: kind: property required: false type: object javaType: java.util.Map deprecated: false secret: false description: A map which contains general SSL connector properties. socketConnectorProperties: kind: property required: false type: object javaType: java.util.Map deprecated: false secret: false description: A map which contains general HTTP connector properties. Uses the same principle as sslSocketConnectorProperties. continuationTimeout: kind: property required: false type: integer javaType: java.lang.Long deprecated: false secret: false description: Allows to set a timeout in millis when using Jetty as consumer (server). By default Jetty uses 30000. You can use a value of = 0 to never expire. If a timeout occurs then the request will be expired and Jetty will return back a http error 503 to the client. This option is only in use when using Jetty with the Asynchronous Routing Engine. useContinuation: kind: property required: false type: boolean javaType: boolean deprecated: false secret: false description: Whether or not to use Jetty continuations for the Jetty Server. sslContextParameters: kind: property required: false type: object javaType: org.apache.camel.util.jsse.SSLContextParameters deprecated: false secret: false description: To configure security using SSLContextParameters responseBufferSize: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: Allows to configure a custom value of the response buffer size on the Jetty connectors. requestBufferSize: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: Allows to configure a custom value of the request buffer size on the Jetty connectors. requestHeaderSize: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: Allows to configure a custom value of the request header size on the Jetty connectors. responseHeaderSize: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: Allows to configure a custom value of the response header size on the Jetty connectors. proxyHost: kind: property required: false type: string javaType: java.lang.String deprecated: false secret: false description: To use a http proxy to configure the hostname. proxyPort: kind: property required: false type: integer javaType: java.lang.Integer deprecated: false secret: false description: To use a http proxy to configure the port number. useXForwardedForHeader: kind: property required: false type: boolean javaType: boolean deprecated: false secret: false description: To use the X-Forwarded-For header in HttpServletRequest.getRemoteAddr. sendServerVersion: kind: property required: false type: boolean javaType: boolean deprecated: false secret: false description: If the option is true jetty server will send the date header to the client which sends the request. NOTE please make sure there is no any other camel-jetty endpoint is share the same port otherwise this option may not work as expected. allowJavaSerializedObject: kind: property type: boolean javaType: boolean deprecated: false secret: false description: Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. headerFilterStrategy: kind: property type: object javaType: org.apache.camel.spi.HeaderFilterStrategy deprecated: false secret: false description: To use a custom HeaderFilterStrategy to filter header to and from Camel message. properties: httpUri: kind: path group: producer label: producer required: true type: string javaType: java.net.URI deprecated: false secret: false description: The url of the HTTP endpoint to call. chunked: kind: parameter group: common type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: If this option is false the Servlet will disable the HTTP streaming and set the content-length header on the response disableStreamCache: kind: parameter group: common label: common type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Determines whether or not the raw input stream from Servlet is cached or not (Camel will read the stream into a in memory/overflow to file Stream caching) cache. By default Camel will cache the Servlet 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. DefaultHttpBinding will copy the request input stream into a stream cache and put it into message body if this option is false to support reading the stream multiple times. If you use Servlet to bridge/proxy an endpoint then consider enabling this option to improve performance in case you do not need to read the message payload multiple times. The http/http4 producer will by default cache the response body stream. If setting this option to true then the producers will not cache the response body stream but use the response stream as-is as the message body. enableMultipartFilter: kind: parameter group: common type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Whether Jetty org.eclipse.jetty.servlets.MultiPartFilter is enabled or not. You should set this value to false when bridging endpoints to ensure multipart requests is proxied/bridged as well. headerFilterStrategy: kind: parameter group: common type: object javaType: org.apache.camel.spi.HeaderFilterStrategy deprecated: false secret: false description: To use a custom HeaderFilterStrategy to filter header to and from Camel message. httpBinding: kind: parameter group: common type: object javaType: org.apache.camel.http.common.HttpBinding deprecated: false secret: false description: To use a custom HttpBinding to control the mapping between Camel message and HttpClient. transferException: kind: parameter group: common type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: 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 content type. On the producer side the exception will be deserialized and thrown as is instead of the HttpOperationFailedException. The caused exception is required to be serialized. This is by default turned off. If you enable this then be aware that Java will deserialize the incoming data from the request to Java and that can be a potential security risk. async: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Configure the consumer to work in async mode bridgeErrorHandler: kind: parameter group: consumer label: consumer type: boolean javaType: boolean optionalPrefix: consumer. deprecated: false secret: false defaultValue: false description: Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored. continuationTimeout: kind: parameter group: consumer label: consumer type: integer javaType: java.lang.Long deprecated: false secret: false defaultValue: "30000" description: Allows to set a timeout in millis when using Jetty as consumer (server). By default Jetty uses 30000. You can use a value of = 0 to never expire. If a timeout occurs then the request will be expired and Jetty will return back a http error 503 to the client. This option is only in use when using Jetty with the Asynchronous Routing Engine. eagerCheckContentAvailable: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Whether to eager check whether the HTTP requests has content if the content-length header is 0 or not present. This can be turned on in case HTTP clients do not send streamed data. enableCORS: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: If the option is true Jetty server will setup the CrossOriginFilter which supports the CORS out of box. enableJmx: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: If this option is true Jetty JMX support will be enabled for this endpoint. See Jetty JMX support for more details. httpMethodRestrict: kind: parameter group: consumer label: consumer type: string javaType: java.lang.String deprecated: false secret: false description: Used to only allow consuming if the HttpMethod matches such as GET/POST/PUT etc. Multiple methods can be specified separated by comma. matchOnUriPrefix: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Whether or not the consumer should try to find a target consumer by matching the URI prefix if no exact match is found. optionsEnabled: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Specifies whether to enable HTTP OPTIONS for this Servlet consumer. By default OPTIONS is turned off. responseBufferSize: kind: parameter group: consumer label: consumer type: integer javaType: java.lang.Integer deprecated: false secret: false description: To use a custom buffer size on the javax.servlet.ServletResponse. sendDateHeader: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: If the option is true jetty server will send the date header to the client which sends the request. NOTE please make sure there is no any other camel-jetty endpoint is share the same port otherwise this option may not work as expected. sendServerVersion: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: If the option is true jetty will send the server header with the jetty version information to the client which sends the request. NOTE please make sure there is no any other camel-jetty endpoint is share the same port otherwise this option may not work as expected. sessionSupport: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Specifies whether to enable the session manager on the server side of Jetty. traceEnabled: kind: parameter group: consumer label: consumer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Specifies whether to enable HTTP TRACE for this Servlet consumer. By default TRACE is turned off. useContinuation: kind: parameter group: consumer label: consumer type: boolean javaType: java.lang.Boolean deprecated: false secret: false description: Whether or not to use Jetty continuations for the Jetty Server. exceptionHandler: kind: parameter group: consumer (advanced) label: consumer,advanced type: object javaType: org.apache.camel.spi.ExceptionHandler optionalPrefix: consumer. deprecated: false secret: false description: To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored. exchangePattern: kind: parameter group: consumer (advanced) label: consumer,advanced type: string javaType: org.apache.camel.ExchangePattern enum: - InOnly - RobustInOnly - InOut - InOptionalOut - OutOnly - RobustOutOnly - OutIn - OutOptionalIn deprecated: false secret: false description: Sets the exchange pattern when the consumer creates an exchange. filterInitParameters: kind: parameter group: consumer (advanced) label: consumer,advanced type: object javaType: java.util.Map prefix: filter. multiValue: true deprecated: false secret: false description: Configuration of the filter init parameters. These parameters will be applied to the filter list before starting the jetty server. filtersRef: kind: parameter group: consumer (advanced) label: consumer,advanced type: string javaType: java.lang.String deprecated: false secret: false description: Allows using a custom filters which is putted into a list and can be find in the Registry. Multiple values can be separated by comma. handlers: kind: parameter group: consumer (advanced) label: consumer,advanced type: string javaType: java.lang.String deprecated: false secret: false description: 'Specifies a comma-delimited set of Handler instances to lookup in your Registry. These handlers are added to the Jetty servlet context (for example to add security). Important: You can not use different handlers with different Jetty endpoints using the same port number. The handlers is associated to the port number. If you need different handlers then use different port numbers.' httpBindingRef: kind: parameter group: consumer (advanced) label: consumer,advanced type: string javaType: java.lang.String deprecated: true secret: false description: Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code. multipartFilter: kind: parameter group: consumer (advanced) label: consumer,advanced type: object javaType: javax.servlet.Filter deprecated: false secret: false description: 'Allows using a custom multipart filter. Note: setting multipartFilterRef forces the value of enableMultipartFilter to true.' multipartFilterRef: kind: parameter group: consumer (advanced) label: consumer,advanced type: string javaType: java.lang.String deprecated: true secret: false description: 'Allows using a custom multipart filter. Note: setting multipartFilterRef forces the value of enableMultipartFilter to true.' authMethodPriority: kind: parameter group: producer label: producer type: string javaType: java.lang.String enum: - Basic - Digest - NTLM deprecated: false secret: false description: Authentication method for proxy either as Basic Digest or NTLM. bridgeEndpoint: kind: parameter group: producer label: producer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: If the option is true HttpProducer will ignore the Exchange.HTTP_URI header and use the endpoint's URI for request. You may also set the option throwExceptionOnFailure to be false to let the HttpProducer send all the fault response back. connectionClose: kind: parameter group: producer label: producer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Specifies whether a Connection Close header must be added to HTTP Request. By default connectionClose is false. copyHeaders: kind: parameter group: producer label: producer type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: If this option is true then IN exchange headers will be copied to OUT exchange headers according to copy strategy. Setting this to false allows to only include the headers from the HTTP response (not propagating IN headers). httpClientMaxThreads: kind: parameter group: producer label: producer type: integer javaType: java.lang.Integer deprecated: false secret: false defaultValue: "254" description: To set a value for maximum number of threads in HttpClient thread pool. This setting override any setting configured on component level. Notice that both a min and max size must be configured. If not set it default to max 254 threads used in Jettys thread pool. httpClientMinThreads: kind: parameter group: producer label: producer type: integer javaType: java.lang.Integer deprecated: false secret: false defaultValue: "8" description: To set a value for minimum number of threads in HttpClient thread pool. This setting override any setting configured on component level. Notice that both a min and max size must be configured. If not set it default to min 8 threads used in Jettys thread pool. ignoreResponseBody: kind: parameter group: producer label: producer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: If this option is true The http producer won't read response body and cache the input stream okStatusCodeRange: kind: parameter group: producer label: producer type: string javaType: java.lang.String deprecated: false secret: false defaultValue: 200-299 description: The status codes which is considered a success response. The values are inclusive. The range must be defined as from-to with the dash included. preserveHostHeader: kind: parameter group: producer label: producer type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: If the option is true HttpProducer will set the Host header to the value contained in the current exchange Host header useful in reverse proxy applications where you want the Host header received by the downstream server to reflect the URL called by the upstream client this allows applications which use the Host header to generate accurate URL's for a proxied service proxyHost: kind: parameter group: producer label: producer type: string javaType: java.lang.String deprecated: false secret: false description: The proxy host name proxyPort: kind: parameter group: producer label: producer type: integer javaType: int deprecated: false secret: false description: The proxy port number throwExceptionOnFailure: kind: parameter group: producer label: producer type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: Option to disable throwing the HttpOperationFailedException in case of failed responses from the remote server. This allows you to get all responses regardless of the HTTP status code. httpClient: kind: parameter group: producer (advanced) label: producer,advanced type: object javaType: org.eclipse.jetty.client.HttpClient deprecated: false secret: false description: 'Sets a shared HttpClient to use for all producers created by this endpoint. By default each producer will use a new http client and not share. Important: Make sure to handle the lifecycle of the shared client such as stopping the client when it is no longer in use. Camel will call the start method on the client to ensure its started when this endpoint creates a producer. This options should only be used in special circumstances.' httpClientParameters: kind: parameter group: producer (advanced) label: producer,advanced type: object javaType: java.util.Map prefix: httpClient. multiValue: true deprecated: false secret: false description: Configuration of Jetty's HttpClient. For example setting httpClient.idleTimeout=30000 sets the idle timeout to 30 seconds. And httpClient.timeout=30000 sets the request timeout to 30 seconds in case you want to timeout sooner if you have long running request/response calls. jettyBinding: kind: parameter group: producer (advanced) label: producer,advanced type: object javaType: org.apache.camel.component.jetty.JettyHttpBinding deprecated: false secret: false description: To use a custom JettyHttpBinding which be used to customize how a response should be written for the producer. jettyBindingRef: kind: parameter group: producer (advanced) label: producer,advanced type: string javaType: java.lang.String deprecated: true secret: false description: To use a custom JettyHttpBinding which be used to customize how a response should be written for the producer. urlRewrite: kind: parameter group: producer (advanced) label: producer,advanced type: object javaType: org.apache.camel.http.common.UrlRewrite deprecated: false secret: false description: Refers to a custom org.apache.camel.component.http.UrlRewrite which allows you to rewrite urls when you bridge/proxy endpoints. See more details at http://camel.apache.org/urlrewrite.html mapHttpMessageBody: kind: parameter group: advanced label: advanced type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: If this option is true then IN exchange Body of the exchange will be mapped to HTTP body. Setting this to false will avoid the HTTP mapping. mapHttpMessageFormUrlEncodedBody: kind: parameter group: advanced label: advanced type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: If this option is true then IN exchange Form Encoded body of the exchange will be mapped to HTTP. Setting this to false will avoid the HTTP Form Encoded body mapping. mapHttpMessageHeaders: kind: parameter group: advanced label: advanced type: boolean javaType: boolean deprecated: false secret: false defaultValue: true description: If this option is true then IN exchange Headers of the exchange will be mapped to HTTP headers. Setting this to false will avoid the HTTP Headers mapping. synchronous: kind: parameter group: advanced label: advanced type: boolean javaType: boolean deprecated: false secret: false defaultValue: false description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported). sslContextParameters: kind: parameter group: security label: security type: object javaType: org.apache.camel.util.jsse.SSLContextParameters deprecated: false secret: false description: To configure security using SSLContextParameters sslContextParametersRef: kind: parameter group: security label: security type: string javaType: java.lang.String deprecated: true secret: false description: To configure security using SSLContextParameters documentation.adoc: "[[Jetty-JettyComponent]]\nJetty Component\n~~~~~~~~~~~~~~~\n\ \nThe *jetty* component provides HTTP-based link:endpoint.html[endpoints]\n\ for consuming and producing HTTP requests. That is, the Jetty component\nbehaves\ \ as a simple Web server. +\n Jetty can also be used as a http client which\ \ mean you can also use it\nwith Camel as a producer.\n\n*Stream*\n\nThe??`assert`?\ ?call appears in this example, because the code is part of\nan unit test.Jetty\ \ is stream based, which means the input it receives is\nsubmitted to Camel\ \ as a stream. That means you will only be able to read\nthe content of the\ \ stream *once*. +\nIf you find a situation where the message body appears to\ \ be empty or\nyou need to access the Exchange.HTTP_RESPONSE_CODE data multiple\ \ times\n(e.g.: doing multicasting, or redelivery error handling), you should\ \ use\nlink:stream-caching.html[Stream caching] or convert the message body\ \ to\na `String` which is safe to be re-read multiple times.\n\nMaven users\ \ will need to add the following dependency to their `pom.xml`\nfor this component:\n\ \n[source,xml]\n------------------------------------------------------------\n\ \n org.apache.camel\n camel-jetty\n\ \ x.x.x\n \n\n------------------------------------------------------------\n\ \n[[Jetty-URIformat]]\nURI format\n^^^^^^^^^^\n\n[source,java]\n----------------------------------------------------\n\ jetty:http://hostname[:port][/resourceUri][?options]\n----------------------------------------------------\n\ \nYou can append query options to the URI in the following format,\n`?option=value&option=value&...`\n\ \n[[Jetty-Options]]\nOptions\n^^^^^^^\n\n\n\n\n\n// component options: START\n\ The Jetty 9 component supports 31 options which are listed below.\n\n\n\n{%\ \ raw %}\n[width=\"100%\",cols=\"2,1m,7\",options=\"header\"]\n|=======================================================================\n\ | Name | Java Type | Description\n| sslKeyPassword | String | The key password\ \ which is used to access the certificate's key entry in the keystore (this\ \ is the same password that is supplied to the keystore command's -keypass option).\n\ | sslPassword | String | The ssl password which is required to access the keystore\ \ file (this is the same password that is supplied to the keystore command's\ \ -storepass option).\n| keystore | String | Specifies the location of the Java\ \ keystore file which contains the Jetty server's own X.509 certificate in a\ \ key entry.\n| errorHandler | ErrorHandler | This option is used to set the\ \ ErrorHandler that Jetty server uses.\n| sslSocketConnectors | Map | A map\ \ which contains per port number specific SSL connectors.\n| socketConnectors\ \ | Map | A map which contains per port number specific HTTP connectors. Uses\ \ the same principle as sslSocketConnectors.\n| httpClientMinThreads | Integer\ \ | To set a value for minimum number of threads in HttpClient thread pool.\ \ Notice that both a min and max size must be configured.\n| httpClientMaxThreads\ \ | Integer | To set a value for maximum number of threads in HttpClient thread\ \ pool. Notice that both a min and max size must be configured.\n| minThreads\ \ | Integer | To set a value for minimum number of threads in server thread\ \ pool. Notice that both a min and max size must be configured.\n| maxThreads\ \ | Integer | To set a value for maximum number of threads in server thread\ \ pool. Notice that both a min and max size must be configured.\n| threadPool\ \ | ThreadPool | To use a custom thread pool for the server. This option should\ \ only be used in special circumstances.\n| enableJmx | boolean | If this option\ \ is true Jetty JMX support will be enabled for this endpoint.\n| jettyHttpBinding\ \ | JettyHttpBinding | To use a custom org.apache.camel.component.jetty.JettyHttpBinding\ \ which are used to customize how a response should be written for the producer.\n\ | httpBinding | HttpBinding | Not to be used - use JettyHttpBinding instead.\n\ | httpConfiguration | HttpConfiguration | Jetty component does not use HttpConfiguration.\n\ | mbContainer | MBeanContainer | To use a existing configured org.eclipse.jetty.jmx.MBeanContainer\ \ if JMX is enabled that Jetty uses for registering mbeans.\n| sslSocketConnectorProperties\ \ | Map | A map which contains general SSL connector properties.\n| socketConnectorProperties\ \ | Map | A map which contains general HTTP connector properties. Uses the same\ \ principle as sslSocketConnectorProperties.\n| continuationTimeout | Long |\ \ Allows to set a timeout in millis when using Jetty as consumer (server). By\ \ default Jetty uses 30000. You can use a value of = 0 to never expire. If a\ \ timeout occurs then the request will be expired and Jetty will return back\ \ a http error 503 to the client. This option is only in use when using Jetty\ \ with the Asynchronous Routing Engine.\n| useContinuation | boolean | Whether\ \ or not to use Jetty continuations for the Jetty Server.\n| sslContextParameters\ \ | SSLContextParameters | To configure security using SSLContextParameters\n\ | responseBufferSize | Integer | Allows to configure a custom value of the response\ \ buffer size on the Jetty connectors.\n| requestBufferSize | Integer | Allows\ \ to configure a custom value of the request buffer size on the Jetty connectors.\n\ | requestHeaderSize | Integer | Allows to configure a custom value of the request\ \ header size on the Jetty connectors.\n| responseHeaderSize | Integer | Allows\ \ to configure a custom value of the response header size on the Jetty connectors.\n\ | proxyHost | String | To use a http proxy to configure the hostname.\n| proxyPort\ \ | Integer | To use a http proxy to configure the port number.\n| useXForwardedForHeader\ \ | boolean | To use the X-Forwarded-For header in HttpServletRequest.getRemoteAddr.\n\ | sendServerVersion | boolean | If the option is true jetty server will send\ \ the date header to the client which sends the request. NOTE please make sure\ \ there is no any other camel-jetty endpoint is share the same port otherwise\ \ this option may not work as expected.\n| allowJavaSerializedObject | boolean\ \ | Whether to allow java serialization when a request uses context-type=application/x-java-serialized-object\ \ This is by default turned off. If you enable this then be aware that Java\ \ will deserialize the incoming data from the request to Java and that can be\ \ a potential security risk.\n| headerFilterStrategy | HeaderFilterStrategy\ \ | To use a custom HeaderFilterStrategy to filter header to and from Camel\ \ message.\n|=======================================================================\n\ {% endraw %}\n// component options: END\n\n\n\n\n\n\n\n\n\n// endpoint options:\ \ START\nThe Jetty 9 component supports 53 endpoint options which are listed\ \ below:\n\n{% raw %}\n[width=\"100%\",cols=\"2,1,1m,1m,5\",options=\"header\"\ ]\n|=======================================================================\n\ | Name | Group | Default | Java Type | Description\n| httpUri | producer | \ \ | URI | *Required* The url of the HTTP endpoint to call.\n| chunked | common\ \ | true | boolean | If this option is false the Servlet will disable the HTTP\ \ streaming and set the content-length header on the response\n| disableStreamCache\ \ | common | false | boolean | Determines whether or not the raw input stream\ \ from Servlet is cached or not (Camel will read the stream into a in memory/overflow\ \ to file Stream caching) cache. By default Camel will cache the Servlet 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. DefaultHttpBinding will copy the request\ \ input stream into a stream cache and put it into message body if this option\ \ is false to support reading the stream multiple times. If you use Servlet\ \ to bridge/proxy an endpoint then consider enabling this option to improve\ \ performance in case you do not need to read the message payload multiple times.\ \ The http/http4 producer will by default cache the response body stream. If\ \ setting this option to true then the producers will not cache the response\ \ body stream but use the response stream as-is as the message body.\n| enableMultipartFilter\ \ | common | false | boolean | Whether Jetty org.eclipse.jetty.servlets.MultiPartFilter\ \ is enabled or not. You should set this value to false when bridging endpoints\ \ to ensure multipart requests is proxied/bridged as well.\n| headerFilterStrategy\ \ | common | | HeaderFilterStrategy | To use a custom HeaderFilterStrategy\ \ to filter header to and from Camel message.\n| httpBinding | common | | HttpBinding\ \ | To use a custom HttpBinding to control the mapping between Camel message\ \ and HttpClient.\n| transferException | common | false | boolean | 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\ \ content type. On the producer side the exception will be deserialized and\ \ thrown as is instead of the HttpOperationFailedException. The caused exception\ \ is required to be serialized. This is by default turned off. If you enable\ \ this then be aware that Java will deserialize the incoming data from the request\ \ to Java and that can be a potential security risk.\n| async | consumer | false\ \ | boolean | Configure the consumer to work in async mode\n| bridgeErrorHandler\ \ | consumer | false | boolean | Allows for bridging the consumer to the Camel\ \ routing Error Handler which mean any exceptions occurred while the consumer\ \ is trying to pickup incoming messages or the likes will now be processed as\ \ a message and handled by the routing Error Handler. By default the consumer\ \ will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions\ \ that will be logged at WARN/ERROR level and ignored.\n| continuationTimeout\ \ | consumer | 30000 | Long | Allows to set a timeout in millis when using Jetty\ \ as consumer (server). By default Jetty uses 30000. You can use a value of\ \ = 0 to never expire. If a timeout occurs then the request will be expired\ \ and Jetty will return back a http error 503 to the client. This option is\ \ only in use when using Jetty with the Asynchronous Routing Engine.\n| eagerCheckContentAvailable\ \ | consumer | false | boolean | Whether to eager check whether the HTTP requests\ \ has content if the content-length header is 0 or not present. This can be\ \ turned on in case HTTP clients do not send streamed data.\n| enableCORS |\ \ consumer | false | boolean | If the option is true Jetty server will setup\ \ the CrossOriginFilter which supports the CORS out of box.\n| enableJmx | consumer\ \ | false | boolean | If this option is true Jetty JMX support will be enabled\ \ for this endpoint. See Jetty JMX support for more details.\n| httpMethodRestrict\ \ | consumer | | String | Used to only allow consuming if the HttpMethod matches\ \ such as GET/POST/PUT etc. Multiple methods can be specified separated by comma.\n\ | matchOnUriPrefix | consumer | false | boolean | Whether or not the consumer\ \ should try to find a target consumer by matching the URI prefix if no exact\ \ match is found.\n| optionsEnabled | consumer | false | boolean | Specifies\ \ whether to enable HTTP OPTIONS for this Servlet consumer. By default OPTIONS\ \ is turned off.\n| responseBufferSize | consumer | | Integer | To use a custom\ \ buffer size on the javax.servlet.ServletResponse.\n| sendDateHeader | consumer\ \ | false | boolean | If the option is true jetty server will send the date\ \ header to the client which sends the request. NOTE please make sure there\ \ is no any other camel-jetty endpoint is share the same port otherwise this\ \ option may not work as expected.\n| sendServerVersion | consumer | true |\ \ boolean | If the option is true jetty will send the server header with the\ \ jetty version information to the client which sends the request. NOTE please\ \ make sure there is no any other camel-jetty endpoint is share the same port\ \ otherwise this option may not work as expected.\n| sessionSupport | consumer\ \ | false | boolean | Specifies whether to enable the session manager on the\ \ server side of Jetty.\n| traceEnabled | consumer | false | boolean | Specifies\ \ whether to enable HTTP TRACE for this Servlet consumer. By default TRACE is\ \ turned off.\n| useContinuation | consumer | | Boolean | Whether or not to\ \ use Jetty continuations for the Jetty Server.\n| exceptionHandler | consumer\ \ (advanced) | | ExceptionHandler | To let the consumer use a custom ExceptionHandler.\ \ Notice if the option bridgeErrorHandler is enabled then this options is not\ \ in use. By default the consumer will deal with exceptions that will be logged\ \ at WARN/ERROR level and ignored.\n| exchangePattern | consumer (advanced)\ \ | | ExchangePattern | Sets the exchange pattern when the consumer creates\ \ an exchange.\n| filterInitParameters | consumer (advanced) | | Map | Configuration\ \ of the filter init parameters. These parameters will be applied to the filter\ \ list before starting the jetty server.\n| filtersRef | consumer (advanced)\ \ | | String | Allows using a custom filters which is putted into a list and\ \ can be find in the Registry. Multiple values can be separated by comma.\n\ | handlers | consumer (advanced) | | String | Specifies a comma-delimited set\ \ of Handler instances to lookup in your Registry. These handlers are added\ \ to the Jetty servlet context (for example to add security). Important: You\ \ can not use different handlers with different Jetty endpoints using the same\ \ port number. The handlers is associated to the port number. If you need different\ \ handlers then use different port numbers.\n| httpBindingRef | consumer (advanced)\ \ | | String | Option to disable throwing the HttpOperationFailedException\ \ in case of failed responses from the remote server. This allows you to get\ \ all responses regardless of the HTTP status code.\n| multipartFilter | consumer\ \ (advanced) | | Filter | Allows using a custom multipart filter. Note: setting\ \ multipartFilterRef forces the value of enableMultipartFilter to true.\n| multipartFilterRef\ \ | consumer (advanced) | | String | Allows using a custom multipart filter.\ \ Note: setting multipartFilterRef forces the value of enableMultipartFilter\ \ to true.\n| authMethodPriority | producer | | String | Authentication method\ \ for proxy either as Basic Digest or NTLM.\n| bridgeEndpoint | producer | false\ \ | boolean | If the option is true HttpProducer will ignore the Exchange.HTTP_URI\ \ header and use the endpoint's URI for request. You may also set the option\ \ throwExceptionOnFailure to be false to let the HttpProducer send all the fault\ \ response back.\n| connectionClose | producer | false | boolean | Specifies\ \ whether a Connection Close header must be added to HTTP Request. By default\ \ connectionClose is false.\n| copyHeaders | producer | true | boolean | If\ \ this option is true then IN exchange headers will be copied to OUT exchange\ \ headers according to copy strategy. Setting this to false allows to only include\ \ the headers from the HTTP response (not propagating IN headers).\n| httpClientMaxThreads\ \ | producer | 254 | Integer | To set a value for maximum number of threads\ \ in HttpClient thread pool. This setting override any setting configured on\ \ component level. Notice that both a min and max size must be configured. If\ \ not set it default to max 254 threads used in Jettys thread pool.\n| httpClientMinThreads\ \ | producer | 8 | Integer | To set a value for minimum number of threads in\ \ HttpClient thread pool. This setting override any setting configured on component\ \ level. Notice that both a min and max size must be configured. If not set\ \ it default to min 8 threads used in Jettys thread pool.\n| ignoreResponseBody\ \ | producer | false | boolean | If this option is true The http producer won't\ \ read response body and cache the input stream\n| okStatusCodeRange | producer\ \ | 200-299 | String | The status codes which is considered a success response.\ \ The values are inclusive. The range must be defined as from-to with the dash\ \ included.\n| preserveHostHeader | producer | false | boolean | If the option\ \ is true HttpProducer will set the Host header to the value contained in the\ \ current exchange Host header useful in reverse proxy applications where you\ \ want the Host header received by the downstream server to reflect the URL\ \ called by the upstream client this allows applications which use the Host\ \ header to generate accurate URL's for a proxied service\n| proxyHost | producer\ \ | | String | The proxy host name\n| proxyPort | producer | | int | The proxy\ \ port number\n| throwExceptionOnFailure | producer | true | boolean | Option\ \ to disable throwing the HttpOperationFailedException in case of failed responses\ \ from the remote server. This allows you to get all responses regardless of\ \ the HTTP status code.\n| httpClient | producer (advanced) | | HttpClient\ \ | Sets a shared HttpClient to use for all producers created by this endpoint.\ \ By default each producer will use a new http client and not share. Important:\ \ Make sure to handle the lifecycle of the shared client such as stopping the\ \ client when it is no longer in use. Camel will call the start method on the\ \ client to ensure its started when this endpoint creates a producer. This options\ \ should only be used in special circumstances.\n| httpClientParameters | producer\ \ (advanced) | | Map | Configuration of Jetty's HttpClient. For example setting\ \ httpClient.idleTimeout=30000 sets the idle timeout to 30 seconds. And httpClient.timeout=30000\ \ sets the request timeout to 30 seconds in case you want to timeout sooner\ \ if you have long running request/response calls.\n| jettyBinding | producer\ \ (advanced) | | JettyHttpBinding | To use a custom JettyHttpBinding which\ \ be used to customize how a response should be written for the producer.\n\ | jettyBindingRef | producer (advanced) | | String | To use a custom JettyHttpBinding\ \ which be used to customize how a response should be written for the producer.\n\ | urlRewrite | producer (advanced) | | UrlRewrite | Refers to a custom org.apache.camel.component.http.UrlRewrite\ \ which allows you to rewrite urls when you bridge/proxy endpoints. See more\ \ details at http://camel.apache.org/urlrewrite.html\n| mapHttpMessageBody |\ \ advanced | true | boolean | If this option is true then IN exchange Body of\ \ the exchange will be mapped to HTTP body. Setting this to false will avoid\ \ the HTTP mapping.\n| mapHttpMessageFormUrlEncodedBody | advanced | true |\ \ boolean | If this option is true then IN exchange Form Encoded body of the\ \ exchange will be mapped to HTTP. Setting this to false will avoid the HTTP\ \ Form Encoded body mapping.\n| mapHttpMessageHeaders | advanced | true | boolean\ \ | If this option is true then IN exchange Headers of the exchange will be\ \ mapped to HTTP headers. Setting this to false will avoid the HTTP Headers\ \ mapping.\n| synchronous | advanced | false | boolean | Sets whether synchronous\ \ processing should be strictly used or Camel is allowed to use asynchronous\ \ processing (if supported).\n| sslContextParameters | security | | SSLContextParameters\ \ | To configure security using SSLContextParameters\n| sslContextParametersRef\ \ | security | | String | To configure security using SSLContextParameters\n\ |=======================================================================\n{%\ \ endraw %}\n// endpoint options: END\n\n\n\n\n\n[[Jetty-MessageHeaders]]\n\ Message Headers\n^^^^^^^^^^^^^^^\n\nCamel uses the same message headers as the\ \ link:http.html[HTTP]\ncomponent. \nFrom Camel 2.2, it also uses (Exchange.HTTP_CHUNKED,CamelHttpChunked)\n\ header to turn on or turn off the chuched encoding on the camel-jetty\nconsumer.\n\ \nCamel also populates *all* request.parameter and request.headers. For\nexample,\ \ given a client request with the URL,\n`http://myserver/myserver?orderid=123`,\ \ the exchange will contain a\nheader named `orderid` with the value 123.\n\n\ Starting with Camel 2.2.0, you can get the request.parameter from the\nmessage\ \ header not only from Get Method, but also other HTTP method.\n\n[[Jetty-Usage]]\n\ Usage\n^^^^^\n\nThe Jetty component supports both consumer and producer endpoints.\n\ Another option for producing to other HTTP endpoints, is to use the\nlink:http.html[HTTP\ \ Component]\n\n[[Jetty-ProducerExample]]\nProducer Example\n^^^^^^^^^^^^^^^^\n\ \nThe following is a basic example of how to send an HTTP request to an\nexisting\ \ HTTP endpoint.\n\nin Java DSL\n\n[source,java]\n---------------------------------------------------------\n\ from(\"direct:start\").to(\"jetty://http://www.google.com\");\n---------------------------------------------------------\n\ \nor in Spring XML\n\n[source,xml]\n---------------------------------------------\n\ \n \n \n\n---------------------------------------------\n\n[[Jetty-ConsumerExample]]\n\ Consumer Example\n^^^^^^^^^^^^^^^^\n\nIn this sample we define a route that\ \ exposes a HTTP service at\n`http://localhost:8080/myapp/myservice`:\n\n*Usage\ \ of localhost*\n\nWhen you specify `localhost` in a URL, Camel exposes the\ \ endpoint only\non the local TCP/IP network interface, so it cannot be accessed\ \ from\noutside the machine it operates on.\n\nIf you need to expose a Jetty\ \ endpoint on a specific network interface,\nthe numerical IP address of this\ \ interface should be used as the host.\nIf you need to expose a Jetty endpoint\ \ on all network interfaces, the\n`0.0.0.0` address should be used.\n\nTo listen\ \ across an entire URI prefix, see\nlink:how-do-i-let-jetty-match-wildcards.html[How\ \ do I let Jetty match\nwildcards].\n\nIf you actually want to expose routes\ \ by HTTP and already have a\nServlet, you should instead refer to the\nhttps://cwiki.apache.org/confluence/pages/viewpage.action?pageId=46339[Servlet\n\ Transport].\n\nOur business logic is implemented in the `MyBookService` class,\ \ which\naccesses the HTTP request contents and then returns a response. +\n\ \ *Note:* The `assert` call appears in this example, because the code is\npart\ \ of an unit test.\n\nThe following sample shows a content-based route that\ \ routes all\nrequests containing the URI parameter, `one`, to the endpoint,\n\ `mock:one`, and all others to `mock:other`.\n\nSo if a client sends the HTTP\ \ request, `http://serverUri?one=hello`, the\nJetty component will copy the\ \ HTTP request parameter, `one` to the\nexchange's `in.header`. We can then\ \ use the `simple` language to route\nexchanges that contain this header to\ \ a specific endpoint and all others\nto another. If we used a language more\ \ powerful than\nlink:simple.html[Simple]??(such as link:el.html[EL] or\nlink:ognl.html[OGNL])?\ ?we could also test for the parameter value and do\nrouting based on the header\ \ value as well.\n\n[[Jetty-SessionSupport]]\nSession Support\n^^^^^^^^^^^^^^^\n\ \nThe session support option, `sessionSupport`, can be used to enable a\n`HttpSession`\ \ object and access the session object while processing the\nexchange. For example,\ \ the following route enables sessions:\n\n[source,xml]\n---------------------------------------------------------------------------\n\ \n \n \n\n---------------------------------------------------------------------------\n\ \nThe `myCode` link:processor.html[Processor] can be instantiated by a\nSpring\ \ `bean` element:\n\n[source,xml]\n--------------------------------------------------------\n\ \n--------------------------------------------------------\n\ \nWhere the processor implementation can access the `HttpSession` as\nfollows:\n\ \n[source,java]\n--------------------------------------------------------------------------------------\n\ public void process(Exchange exchange) throws Exception {\n HttpSession session\ \ = exchange.getIn(HttpMessage.class).getRequest().getSession();\n ...\n\ }\n--------------------------------------------------------------------------------------\n\ \n[[Jetty-SSLSupport(HTTPS)]]\nSSL Support (HTTPS)\n^^^^^^^^^^^^^^^^^^^\n\n\ [[Jetty-UsingtheJSSEConfigurationUtility]]\nUsing the JSSE Configuration Utility\n\ \nAs of Camel 2.8, the Jetty component supports SSL/TLS configuration\nthrough\ \ the link:camel-configuration-utilities.html[Camel JSSE\nConfiguration Utility].?\ ? This utility greatly decreases the amount of\ncomponent specific code you\ \ need to write and is configurable at the\nendpoint and component levels.??\ \ The following examples demonstrate how\nto use the utility with the Jetty\ \ component.\n\n[[Jetty-Programmaticconfigurationofthecomponent]]\nProgrammatic\ \ configuration of the component\n\n[source,java]\n-----------------------------------------------------------------------------------------\n\ KeyStoreParameters ksp = new KeyStoreParameters();\nksp.setResource(\"/users/home/server/keystore.jks\"\ );\nksp.setPassword(\"keystorePassword\");\n\nKeyManagersParameters kmp = new\ \ KeyManagersParameters();\nkmp.setKeyStore(ksp);\nkmp.setKeyPassword(\"keyPassword\"\ );\n\nSSLContextParameters scp = new SSLContextParameters();\nscp.setKeyManagers(kmp);\n\ \nJettyComponent jettyComponent = getContext().getComponent(\"jetty\", JettyComponent.class);\n\ jettyComponent.setSslContextParameters(scp);\n-----------------------------------------------------------------------------------------\n\ \n[[Jetty-SpringDSLbasedconfigurationofendpoint]]\nSpring DSL based configuration\ \ of endpoint\n\n[source,xml]\n----------------------------------------------------------------------------------------\n\ ...\n \n \ \ \n \n \n ...\n\ ...\n \n...\n----------------------------------------------------------------------------------------\n\ \n[[Jetty-ConfiguringJettyDirectly]]\nConfiguring Jetty Directly\n\nJetty provides\ \ SSL support out of the box. To enable Jetty to run in SSL\nmode, simply format\ \ the URI with the `https://` prefix---for example:\n\n[source,xml]\n----------------------------------------------------\n\ \n----------------------------------------------------\n\ \nJetty also needs to know where to load your keystore from and what\npasswords\ \ to use in order to load the correct SSL certificate. Set the\nfollowing JVM\ \ System Properties:\n\n*until Camel 2.2*\n\n* `jetty.ssl.keystore` specifies\ \ the location of the Java keystore file,\nwhich contains the Jetty server's\ \ own X.509 certificate in a _key\nentry_. A key entry stores the X.509 certificate\ \ (effectively, the\n_public key_) and also its associated private key.\n* `jetty.ssl.password`\ \ the store password, which is required to access\nthe keystore file (this is\ \ the same password that is supplied to the\n`keystore` command's `-storepass`\ \ option).\n* `jetty.ssl.keypassword` the key password, which is used to access\ \ the\ncertificate's key entry in the keystore (this is the same password that\n\ is supplied to the `keystore` command's `-keypass` option).\n\n*from Camel 2.3\ \ onwards*\n\n* `org.eclipse.jetty.ssl.keystore` specifies the location of the\ \ Java\nkeystore file, which contains the Jetty server's own X.509 certificate\n\ in a _key entry_. A key entry stores the X.509 certificate (effectively,\nthe\ \ _public key_) and also its associated private key.\n* `org.eclipse.jetty.ssl.password`\ \ the store password, which is required\nto access the keystore file (this is\ \ the same password that is supplied\nto the `keystore` command's `-storepass`\ \ option).\n* `org.eclipse.jetty.ssl.keypassword` the key password, which is\ \ used to\naccess the certificate's key entry in the keystore (this is the same\n\ password that is supplied to the `keystore` command's `-keypass`\noption).\n\ \nFor details of how to configure SSL on a Jetty endpoint, read the\nfollowing\ \ documentation at the Jetty Site:\nhttp://docs.codehaus.org/display/JETTY/How+to+configure+SSL[http://docs.codehaus.org/display/JETTY/How+to+configure+SSL]\n\ \nSome SSL properties aren't exposed directly by Camel, however Camel does\n\ expose the underlying SslSocketConnector, which will allow you to set\nproperties\ \ like needClientAuth for mutual authentication requiring a\nclient certificate\ \ or wantClientAuth for mutual authentication where a\nclient doesn't need a\ \ certificate but can have one. There's a slight\ndifference between the various\ \ Camel versions:\n\n*Up to Camel 2.2*\n\n[source,xml]\n-----------------------------------------------------------------------------\n\ \n \n \n \n \n \n \ \ \n \ \ \n \n \n \n \n\ \ \n \n\n-----------------------------------------------------------------------------\n\ \n*Camel 2.3, 2.4*\n\n[source,xml]\n------------------------------------------------------------------------------\n\ \n \n \n \n \n \n \ \ \n \ \ \n \n \n \n \n\ \ \n \n\n------------------------------------------------------------------------------\n\ \n*From Camel 2.5 we switch to use SslSelectChannelConnector *\n\n[source,xml]\n\ -------------------------------------------------------------------------------------\n\ \n \n \n \n \n \n \ \ \n \ \ \n \n \n \n \n\ \ \n \n\n-------------------------------------------------------------------------------------\n\ \nThe value you use as keys in the above map is the port you configure\nJetty\ \ to listen on.\n\n[[Jetty-ConfiguringgeneralSSLproperties]]\nConfiguring general\ \ SSL properties\n++++++++++++++++++++++++++++++++++\n\n*Available as of Camel\ \ 2.5*\n\nInstead of a per port number specific SSL socket connector (as shown\n\ above) you can now configure general properties which applies for all\nSSL socket\ \ connectors (which is not explicit configured as above with\nthe port number\ \ as entry).\n\n[source,xml]\n-----------------------------------------------------------------------------\n\ \n \n \n \ \ \n \n \n \n \n \n \n\n\ -----------------------------------------------------------------------------\n\ \n[[Jetty-HowtoobtainreferencetotheX509Certificate]]\nHow to obtain reference\ \ to the X509Certificate\n++++++++++++++++++++++++++++++++++++++++++++++\n\n\ Jetty stores a reference to the certificate in the HttpServletRequest\nwhich\ \ you can access from code as follows:\n\n[source,java]\n--------------------------------------------------------------------------------------------------\n\ HttpServletRequest req = exchange.getIn().getBody(HttpServletRequest.class);\n\ X509Certificate cert = (X509Certificate) req.getAttribute(\"javax.servlet.request.X509Certificate\"\ )\n--------------------------------------------------------------------------------------------------\n\ \n[[Jetty-ConfiguringgeneralHTTPproperties]]\nConfiguring general HTTP properties\n\ +++++++++++++++++++++++++++++++++++\n\n*Available as of Camel 2.5*\n\nInstead\ \ of a per port number specific HTTP socket connector (as shown\nabove) you\ \ can now configure general properties which applies for all\nHTTP socket connectors\ \ (which is not explicit configured as above with\nthe port number as entry).\n\ \n[source,xml]\n-----------------------------------------------------------------------------\n\ \n \n \n \ \ \n \n \n \n\n-----------------------------------------------------------------------------\n\ \n[[Jetty-ObtainingX-Forwarded-ForheaderwithHttpServletRequest.getRemoteAddr]]\n\ Obtaining X-Forwarded-For header with HttpServletRequest.getRemoteAddr()\n++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\n\ \nIf the HTTP requests are handled by an Apache server and forwarded to\njetty\ \ with mod_proxy, the original client IP address is in the\nX-Forwarded-For\ \ header and the HttpServletRequest.getRemoteAddr() will\nreturn the address\ \ of the Apache proxy.\n\nJetty has a forwarded property which takes the value\ \ from\nX-Forwarded-For and places it in the HttpServletRequest remoteAddr\n\ property.?? This property is not available directly through the endpoint\nconfiguration\ \ but it can be easily added using the socketConnectors\nproperty:\n\n[source,xml]\n\ ----------------------------------------------------------------------------------\n\ \n \n \n \n \n \n \ \ \n \n \n \n\ \n----------------------------------------------------------------------------------\n\ \nThis is particularly useful when an existing Apache server handles TLS\nconnections\ \ for a domain and proxies them to application servers\ninternally.\n\n[[Jetty-DefaultbehaviorforreturningHTTPstatuscodes]]\n\ Default behavior for returning HTTP status codes\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ \nThe default behavior of HTTP status codes is defined by the\n`org.apache.camel.component.http.DefaultHttpBinding`\ \ class, which\nhandles how a response is written and also sets the HTTP status\ \ code.\n\nIf the exchange was processed successfully, the 200 HTTP status code\ \ is\nreturned. +\n If the exchange failed with an exception, the 500 HTTP status\ \ code is\nreturned, and the stacktrace is returned in the body. If you want\ \ to\nspecify which HTTP status code to return, set the code in the\n`Exchange.HTTP_RESPONSE_CODE`\ \ header of the OUT message.\n\n[[Jetty-CustomizingHttpBinding]]\nCustomizing\ \ HttpBinding\n^^^^^^^^^^^^^^^^^^^^^^^\n\nBy default, Camel uses the\n`org.apache.camel.component.http.DefaultHttpBinding`\ \ to handle how a\nresponse is written. If you like, you can customize this\ \ behavior either\nby implementing your own `HttpBinding` class or by extending\n\ `DefaultHttpBinding` and overriding the appropriate methods.\n\nThe following\ \ example shows how to customize the `DefaultHttpBinding` in\norder to change\ \ how exceptions are returned:\n\nWe can then create an instance of our binding\ \ and register it in the\nSpring registry as follows:\n\n[source,xml]\n---------------------------------------------------------\n\ \n---------------------------------------------------------\n\ \nAnd then we can reference this binding when we define the route:\n\n[source,xml]\n\ ---------------------------------------------------------------------------------------------------------------------------\n\ \n---------------------------------------------------------------------------------------------------------------------------\n\ \n[[Jetty-Jettyhandlersandsecurityconfiguration]]\nJetty handlers and security\ \ configuration\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nYou can configure\ \ a list of Jetty handlers on the endpoint, which can be\nuseful for enabling\ \ advanced Jetty security features. These handlers are\nconfigured in Spring\ \ XML as follows:\n\n[source,xml]\n----------------------------------------------------------------------------------\n\ <-- Jetty Security handling -->\n\n \n \n\n\n\n \n \n\ \ \n\n\n\n\ \ \n \n\n\n\n \n \n\n----------------------------------------------------------------------------------\n\ \n*And from Camel 2.3 onwards* you can configure a list of Jetty handlers\n\ as follows:\n\n[source,xml]\n----------------------------------------------------------------------------------------\n\ <-- Jetty Security handling -->\n\n \n \n \n\n\n\n \n \n\n\n\n \n \n \n \n \n\ \ \n \n \n\ \n----------------------------------------------------------------------------------------\n\ \nYou can then define the endpoint as:\n\n[source,java]\n--------------------------------------------------------------------\n\ from(\"jetty:http://0.0.0.0:9080/myservice?handlers=securityHandler\")\n--------------------------------------------------------------------\n\ \nIf you need more handlers, set the `handlers` option equal to a\ncomma-separated\ \ list of bean IDs.\n\n[[Jetty-HowtoreturnacustomHTTP500replymessage]]\nHow\ \ to return a custom HTTP 500 reply message\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\ \nYou may want to return a custom reply message when something goes wrong,\n\ instead of the default reply message Camel link:jetty.html[Jetty]\nreplies with.\ \ +\n You could use a custom `HttpBinding` to be in control of the message\n\ mapping, but often it may be easier to use Camel's\nlink:exception-clause.html[Exception\ \ Clause] to construct the custom\nreply message. For example as show here,\ \ where we return\n`Dude something went wrong` with HTTP error code 500:\n\n\ [[Jetty-Multi-partFormsupport]]\nMulti-part Form support\n^^^^^^^^^^^^^^^^^^^^^^^\n\ \nFrom Camel 2.3.0, camel-jetty support to multipart form post out of box.\n\ The submitted form-data are mapped into the message header. Camel-jetty\ncreates\ \ an attachment for each uploaded file. The file name is mapped to\nthe name\ \ of the attachment. The content type is set as the content type\nof the attachment\ \ file name. You can find the example here.\n\n*Note: getName() functions as\ \ shown below in versions 2.5 and higher. In\nearlier versions you receive the\ \ temporary file name for the attachment\ninstead*\n\n[[Jetty-JettyJMXsupport]]\n\ Jetty JMX support\n^^^^^^^^^^^^^^^^^\n\nFrom Camel 2.3.0, camel-jetty supports\ \ the enabling of Jetty's JMX\ncapabilities at the component and endpoint level\ \ with the endpoint\nconfiguration taking priority. Note that JMX must be enabled\ \ within the\nCamel context in order to enable JMX support in this component\ \ as the\ncomponent provides Jetty with a reference to the MBeanServer registered\n\ with the Camel context. Because the camel-jetty component caches and\nreuses\ \ Jetty resources for a given protocol/host/port pairing, this\nconfiguration\ \ option will only be evaluated during the creation of the\nfirst endpoint to\ \ use a protocol/host/port pairing. For example, given\ntwo routes created from\ \ the following XML fragments, JMX support would\nremain enabled for all endpoints\ \ listening on \"https://0.0.0.0\".\n\n[source,xml]\n--------------------------------------------------------------------\n\ \n--------------------------------------------------------------------\n\ \n[source,xml]\n---------------------------------------------------------------------\n\ \n---------------------------------------------------------------------\n\ \nThe camel-jetty component also provides for direct configuration of the\n\ Jetty MBeanContainer. Jetty creates MBean names dynamically. If you are\nrunning\ \ another instance of Jetty outside of the Camel context and\nsharing the same\ \ MBeanServer between the instances, you can provide both\ninstances with a\ \ reference to the same MBeanContainer in order to avoid\nname collisions when\ \ registering Jetty MBeans.\n\n[[Jetty-SeeAlso]]\nSee Also\n^^^^^^^^\n\n* link:configuring-camel.html[Configuring\ \ Camel]\n* link:component.html[Component]\n* link:endpoint.html[Endpoint]\n\ * link:getting-started.html[Getting Started]\n\n* link:http.html[HTTP]\n\n"