You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Amit Patel (JIRA)" <ji...@apache.org> on 2012/09/07 00:28:07 UTC
[jira] [Created] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Amit Patel created CAMEL-5575:
---------------------------------
Summary: Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
Key: CAMEL-5575
URL: https://issues.apache.org/jira/browse/CAMEL-5575
Project: Camel
Issue Type: New Feature
Components: camel-http
Reporter: Amit Patel
Priority: Critical
Fix For: 2.10.1
Attachments: HttpComponent.java
Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint.
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
String addressUri = uri;
if (!uri.startsWith("http4:") && !uri.startsWith("https4:")) {
addressUri = remaining;
}
Map<String, Object> httpClientParameters = new HashMap<String, Object>(parameters);
// http client can be configured from URI options
HttpParams clientParams = configureHttpParams(parameters);
// validate that we could resolve all httpClient. parameters as this component is lenient
validateParameters(uri, parameters, "httpClient.");
HttpBinding httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBindingRef", HttpBinding.class);
if (httpBinding == null) {
httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBinding", HttpBinding.class);
}
HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
if (httpHeaderFilterStrategy == null) {
httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
}
HttpClientConfigurer httpClientConfigurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurerRef", HttpClientConfigurer.class);
if (httpClientConfigurer == null) {
httpClientConfigurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurer", HttpClientConfigurer.class);
}
HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef", HttpContext.class);
if (httpContext == null) {
httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
}
X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters, "x509HostnameVerifier", X509HostnameVerifier.class);
if (x509HostnameVerifier == null) {
x509HostnameVerifier = getX509HostnameVerifier();
}
SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class);
if (sslContextParameters == null) {
sslContextParameters = getSslContextParameters();
}
boolean secure = HttpHelper.isSecureConnection(uri);
// create the configurer to use for this endpoint
HttpClientConfigurer configurer = createHttpClientConfigurer(parameters, secure);
URI endpointUri = URISupport.createRemainingURI(new URI(addressUri), httpClientParameters);
// create the endpoint and set the http uri to be null
HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, clientParams, clientConnectionManager, configurer);
// configure the endpoint
setProperties(endpoint, parameters);
// The httpUri should be start with http or https
String httpUriAddress = addressUri;
if (addressUri.startsWith("http4")) {
httpUriAddress = "http" + addressUri.substring(5);
}
if (addressUri.startsWith("https4")) {
httpUriAddress = "https" + addressUri.substring(6);
}
// restructure uri to be based on the parameters left as we dont want to include the Camel internal options
// build up the http uri
URI httpUri = URISupport.createRemainingURI(new URI(httpUriAddress), parameters);
// validate http uri that end-user did not duplicate the http part that can be a common error
String part = httpUri.getSchemeSpecificPart();
if (part != null) {
part = part.toLowerCase();
if (part.startsWith("//http//") || part.startsWith("//https//") || part.startsWith("//http://") || part.startsWith("//https://")) {
throw new ResolveEndpointFailedException(uri,
"The uri part is not configured correctly. You have duplicated the http(s) protocol.");
}
}
endpoint.setHttpUri(httpUri);
if (httpHeaderFilterStrategy != null) {
endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
} else {
setEndpointHeaderFilterStrategy(endpoint);
}
endpoint.setBinding(getHttpBinding());
if (httpBinding != null) {
endpoint.setHttpBinding(httpBinding);
}
if (httpClientConfigurer != null) {
endpoint.setHttpClientConfigurer(httpClientConfigurer);
}
endpoint.setHttpContext(getHttpContext());
if (httpContext != null) {
endpoint.setHttpContext(httpContext);
}
// register port on schema registry
int port = getPort(httpUri);
registerPort(secure, x509HostnameVerifier, port, sslContextParameters);
return endpoint;
}
private static int getPort(URI uri) {
int port = uri.getPort();
if (port < 0) {
if ("http4".equals(uri.getScheme()) || "http".equals(uri.getScheme())) {
port = 80;
} else if ("https4".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
port = 443;
} else {
throw new IllegalArgumentException("Unknown scheme, cannot determine port number for uri: " + uri);
}
}
return port;
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Closed] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Müller closed CAMEL-5575.
-----------------------------------
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Christian Müller
> Fix For: 2.9.6, 2.10.4, 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Müller updated CAMEL-5575:
------------------------------------
Fix Version/s: 2.10.4
2.9.6
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Christian Müller
> Fix For: 2.9.6, 2.10.4, 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13510080#comment-13510080 ]
Christian Müller commented on CAMEL-5575:
-----------------------------------------
I have back ported this features to Camel 2.9.6 and 2.10.4.
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Christian Müller
> Fix For: 2.9.6, 2.10.4, 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Amit Patel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509706#comment-13509706 ]
Amit Patel commented on CAMEL-5575:
-----------------------------------
Christian,
The changes to add this feature is minor and risk free. Actually this feature help us to resolve the defect. We have been waiting for last two months for Camel 2.11.0 release, but Camel 2.11.0 is not going to release pretty soon.
We really appreciate your help!
Thanks,
Amit Patel
On Dec 3, 2012, at 5:51 PM, Christian Müller (JIRA) <ji...@apache.org>> wrote:
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509287#comment-13509287 ]
Christian Müller commented on CAMEL-5575:
-----------------------------------------
Camel 2.9.5 and 2.10.3 are already in VOTE. I'm afraid it's to late to back port this fix to these versions.
http://camel.465427.n5.nabble.com/VOTE-Release-Apache-Camel-2-9-5-td5723412.html
http://camel.465427.n5.nabble.com/VOTE-Release-Apache-Camel-2-10-3-td5723516.html
Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
-------------------------------------------------------------------------
Key: CAMEL-5575
URL: https://issues.apache.org/jira/browse/CAMEL-5575
Project: Camel
Issue Type: New Feature
Components: camel-http
Reporter: Amit Patel
Assignee: Willem Jiang
Fix For: 2.11.0
Attachments: HttpComponent.java
Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
if (httpHeaderFilterStrategy == null) {
httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
}
if (httpHeaderFilterStrategy != null) {
endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
} else {
setEndpointHeaderFilterStrategy(endpoint);
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Willem Jiang
> Fix For: 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Amit Patel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Patel updated CAMEL-5575:
------------------------------
Attachment: HttpComponent.java
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Priority: Critical
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint.
>
> @Override
> protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
> String addressUri = uri;
> if (!uri.startsWith("http4:") && !uri.startsWith("https4:")) {
> addressUri = remaining;
> }
> Map<String, Object> httpClientParameters = new HashMap<String, Object>(parameters);
> // http client can be configured from URI options
> HttpParams clientParams = configureHttpParams(parameters);
> // validate that we could resolve all httpClient. parameters as this component is lenient
> validateParameters(uri, parameters, "httpClient.");
>
> HttpBinding httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBindingRef", HttpBinding.class);
> if (httpBinding == null) {
> httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBinding", HttpBinding.class);
> }
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> HttpClientConfigurer httpClientConfigurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurerRef", HttpClientConfigurer.class);
> if (httpClientConfigurer == null) {
> httpClientConfigurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurer", HttpClientConfigurer.class);
> }
> HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef", HttpContext.class);
> if (httpContext == null) {
> httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
> }
> X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters, "x509HostnameVerifier", X509HostnameVerifier.class);
> if (x509HostnameVerifier == null) {
> x509HostnameVerifier = getX509HostnameVerifier();
> }
>
> SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class);
> if (sslContextParameters == null) {
> sslContextParameters = getSslContextParameters();
> }
>
> boolean secure = HttpHelper.isSecureConnection(uri);
> // create the configurer to use for this endpoint
> HttpClientConfigurer configurer = createHttpClientConfigurer(parameters, secure);
> URI endpointUri = URISupport.createRemainingURI(new URI(addressUri), httpClientParameters);
> // create the endpoint and set the http uri to be null
> HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, clientParams, clientConnectionManager, configurer);
> // configure the endpoint
> setProperties(endpoint, parameters);
> // The httpUri should be start with http or https
> String httpUriAddress = addressUri;
> if (addressUri.startsWith("http4")) {
> httpUriAddress = "http" + addressUri.substring(5);
> }
> if (addressUri.startsWith("https4")) {
> httpUriAddress = "https" + addressUri.substring(6);
> }
> // restructure uri to be based on the parameters left as we dont want to include the Camel internal options
> // build up the http uri
> URI httpUri = URISupport.createRemainingURI(new URI(httpUriAddress), parameters);
> // validate http uri that end-user did not duplicate the http part that can be a common error
> String part = httpUri.getSchemeSpecificPart();
> if (part != null) {
> part = part.toLowerCase();
> if (part.startsWith("//http//") || part.startsWith("//https//") || part.startsWith("//http://") || part.startsWith("//https://")) {
> throw new ResolveEndpointFailedException(uri,
> "The uri part is not configured correctly. You have duplicated the http(s) protocol.");
> }
> }
> endpoint.setHttpUri(httpUri);
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
> endpoint.setBinding(getHttpBinding());
> if (httpBinding != null) {
> endpoint.setHttpBinding(httpBinding);
> }
> if (httpClientConfigurer != null) {
> endpoint.setHttpClientConfigurer(httpClientConfigurer);
> }
> endpoint.setHttpContext(getHttpContext());
> if (httpContext != null) {
> endpoint.setHttpContext(httpContext);
> }
> // register port on schema registry
> int port = getPort(httpUri);
> registerPort(secure, x509HostnameVerifier, port, sslContextParameters);
> return endpoint;
> }
>
> private static int getPort(URI uri) {
> int port = uri.getPort();
> if (port < 0) {
> if ("http4".equals(uri.getScheme()) || "http".equals(uri.getScheme())) {
> port = 80;
> } else if ("https4".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
> port = 443;
> } else {
> throw new IllegalArgumentException("Unknown scheme, cannot determine port number for uri: " + uri);
> }
> }
> return port;
> }
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang updated CAMEL-5575:
--------------------------------
Priority: Major (was: Critical)
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Comment Edited] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450273#comment-13450273 ]
Willem Jiang edited comment on CAMEL-5575 at 9/7/12 1:18 PM:
-------------------------------------------------------------
You can setup you customer HeaderFilterStrategy by setting it directly on the HttpComponent like this.
{code}
HttpComponent httpComponent = new HttpComponent();
HeaderFilterStrategy headerFilterStrategy = new CustomeHeaderFilterStrategy();
httpComponent.setHeaderFilterStrategy(headerFilterStrategy);
camelContext.addComponent("http4", httpComponent);
{code}
was (Author: njiang):
You can setup you customer HeaderFilterStrategy by setting it directly on the HttpComponent like this.
{code}
HttpComponent httpComponent = new HttpComponent();
HeaderFilterStrategy headerFilterStrategy = new CustomeHeaderFilterStrategy();
httpComponent.setHeaderFilterStrategy(headerFilterStrategy);
CamelContext.addComponent("http4", httpComponent);
{code}
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Amit Patel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Patel updated CAMEL-5575:
------------------------------
Description:
Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
if (httpHeaderFilterStrategy == null) {
httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
}
if (httpHeaderFilterStrategy != null) {
endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
} else {
setEndpointHeaderFilterStrategy(endpoint);
}
was:
Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached
HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
if (httpHeaderFilterStrategy == null) {
httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
}
if (httpHeaderFilterStrategy != null) {
endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
} else {
setEndpointHeaderFilterStrategy(endpoint);
}
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Priority: Critical
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang reassigned CAMEL-5575:
-----------------------------------
Assignee: Willem Jiang
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Willem Jiang
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450447#comment-13450447 ]
Willem Jiang commented on CAMEL-5575:
-------------------------------------
As the user could write a customer HeaderFilterStrategy without extending the HttpHeaderFilterStrategy, I'd like to change the option name to "headerFilterStrategy".
The patch will be applied to camel-http and camel-http4 components.
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Willem Jiang
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Amit Patel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Patel updated CAMEL-5575:
------------------------------
Description:
Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached
HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
if (httpHeaderFilterStrategy == null) {
httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
}
if (httpHeaderFilterStrategy != null) {
endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
} else {
setEndpointHeaderFilterStrategy(endpoint);
}
was:
Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint.
@Override
protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
String addressUri = uri;
if (!uri.startsWith("http4:") && !uri.startsWith("https4:")) {
addressUri = remaining;
}
Map<String, Object> httpClientParameters = new HashMap<String, Object>(parameters);
// http client can be configured from URI options
HttpParams clientParams = configureHttpParams(parameters);
// validate that we could resolve all httpClient. parameters as this component is lenient
validateParameters(uri, parameters, "httpClient.");
HttpBinding httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBindingRef", HttpBinding.class);
if (httpBinding == null) {
httpBinding = resolveAndRemoveReferenceParameter(parameters, "httpBinding", HttpBinding.class);
}
HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
if (httpHeaderFilterStrategy == null) {
httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
parameters, "httpHeaderFilterStrategy",
HttpHeaderFilterStrategy.class);
}
HttpClientConfigurer httpClientConfigurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurerRef", HttpClientConfigurer.class);
if (httpClientConfigurer == null) {
httpClientConfigurer = resolveAndRemoveReferenceParameter(parameters, "httpClientConfigurer", HttpClientConfigurer.class);
}
HttpContext httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContextRef", HttpContext.class);
if (httpContext == null) {
httpContext = resolveAndRemoveReferenceParameter(parameters, "httpContext", HttpContext.class);
}
X509HostnameVerifier x509HostnameVerifier = resolveAndRemoveReferenceParameter(parameters, "x509HostnameVerifier", X509HostnameVerifier.class);
if (x509HostnameVerifier == null) {
x509HostnameVerifier = getX509HostnameVerifier();
}
SSLContextParameters sslContextParameters = resolveAndRemoveReferenceParameter(parameters, "sslContextParametersRef", SSLContextParameters.class);
if (sslContextParameters == null) {
sslContextParameters = getSslContextParameters();
}
boolean secure = HttpHelper.isSecureConnection(uri);
// create the configurer to use for this endpoint
HttpClientConfigurer configurer = createHttpClientConfigurer(parameters, secure);
URI endpointUri = URISupport.createRemainingURI(new URI(addressUri), httpClientParameters);
// create the endpoint and set the http uri to be null
HttpEndpoint endpoint = new HttpEndpoint(endpointUri.toString(), this, clientParams, clientConnectionManager, configurer);
// configure the endpoint
setProperties(endpoint, parameters);
// The httpUri should be start with http or https
String httpUriAddress = addressUri;
if (addressUri.startsWith("http4")) {
httpUriAddress = "http" + addressUri.substring(5);
}
if (addressUri.startsWith("https4")) {
httpUriAddress = "https" + addressUri.substring(6);
}
// restructure uri to be based on the parameters left as we dont want to include the Camel internal options
// build up the http uri
URI httpUri = URISupport.createRemainingURI(new URI(httpUriAddress), parameters);
// validate http uri that end-user did not duplicate the http part that can be a common error
String part = httpUri.getSchemeSpecificPart();
if (part != null) {
part = part.toLowerCase();
if (part.startsWith("//http//") || part.startsWith("//https//") || part.startsWith("//http://") || part.startsWith("//https://")) {
throw new ResolveEndpointFailedException(uri,
"The uri part is not configured correctly. You have duplicated the http(s) protocol.");
}
}
endpoint.setHttpUri(httpUri);
if (httpHeaderFilterStrategy != null) {
endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
} else {
setEndpointHeaderFilterStrategy(endpoint);
}
endpoint.setBinding(getHttpBinding());
if (httpBinding != null) {
endpoint.setHttpBinding(httpBinding);
}
if (httpClientConfigurer != null) {
endpoint.setHttpClientConfigurer(httpClientConfigurer);
}
endpoint.setHttpContext(getHttpContext());
if (httpContext != null) {
endpoint.setHttpContext(httpContext);
}
// register port on schema registry
int port = getPort(httpUri);
registerPort(secure, x509HostnameVerifier, port, sslContextParameters);
return endpoint;
}
private static int getPort(URI uri) {
int port = uri.getPort();
if (port < 0) {
if ("http4".equals(uri.getScheme()) || "http".equals(uri.getScheme())) {
port = 80;
} else if ("https4".equals(uri.getScheme()) || "https".equals(uri.getScheme())) {
port = 443;
} else {
throw new IllegalArgumentException("Unknown scheme, cannot determine port number for uri: " + uri);
}
}
return port;
}
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Priority: Critical
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Willem Jiang resolved CAMEL-5575.
---------------------------------
Resolution: Fixed
Fix Version/s: (was: 2.10.1)
2.11.0
Applied the patch into trunk and also update the wiki page for it.
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Willem Jiang
> Fix For: 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Christian Müller reassigned CAMEL-5575:
---------------------------------------
Assignee: Christian Müller (was: Willem Jiang)
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Christian Müller
> Fix For: 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Willem Jiang (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13450273#comment-13450273 ]
Willem Jiang commented on CAMEL-5575:
-------------------------------------
You can setup you customer HeaderFilterStrategy by setting it directly on the HttpComponent like this.
{code}
HttpComponent httpComponent = new HttpComponent();
HeaderFilterStrategy headerFilterStrategy = new CustomeHeaderFilterStrategy();
httpComponent.setHeaderFilterStrategy(headerFilterStrategy);
CamelContext.addComponent("http4", httpComponent);
{code}
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Priority: Critical
> Fix For: 2.10.1
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Amit Patel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13508791#comment-13508791 ]
Amit Patel commented on CAMEL-5575:
-----------------------------------
Would you please add this feature to 2.9.5 and Camel 2.10.3 releases so we don't have to wait for 2.11.0.
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Willem Jiang
> Fix For: 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (CAMEL-5575) Add new HttpEndpoint Option
"httpHeaderFilterStrategy" on Http4 component
Posted by "Christian Müller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/CAMEL-5575?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13509287#comment-13509287 ]
Christian Müller commented on CAMEL-5575:
-----------------------------------------
Camel 2.9.5 and 2.10.3 are already in VOTE. I'm afraid it's to late to back port this fix to these versions.
http://camel.465427.n5.nabble.com/VOTE-Release-Apache-Camel-2-9-5-td5723412.html
http://camel.465427.n5.nabble.com/VOTE-Release-Apache-Camel-2-10-3-td5723516.html
> Add new HttpEndpoint Option "httpHeaderFilterStrategy" on Http4 component
> -------------------------------------------------------------------------
>
> Key: CAMEL-5575
> URL: https://issues.apache.org/jira/browse/CAMEL-5575
> Project: Camel
> Issue Type: New Feature
> Components: camel-http
> Reporter: Amit Patel
> Assignee: Willem Jiang
> Fix For: 2.11.0
>
> Attachments: HttpComponent.java
>
>
> Our third-party application accepts Date as Http header, but HttpHeaderFilterStrategy.java filters the date. To support out third-party application I want new feature to add Custom http filter on a Http4 Endpoint.
> I made the following changes on HttpComponent createEndpoint method to support custom http filter as opetion qq on Http4 Endpoint. Please find source code in the attached HttpComponent.java file.
>
>
> HttpHeaderFilterStrategy httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> if (httpHeaderFilterStrategy == null) {
> httpHeaderFilterStrategy = resolveAndRemoveReferenceParameter(
> parameters, "httpHeaderFilterStrategy",
> HttpHeaderFilterStrategy.class);
> }
>
> if (httpHeaderFilterStrategy != null) {
> endpoint.setHeaderFilterStrategy(httpHeaderFilterStrategy);
> } else {
> setEndpointHeaderFilterStrategy(endpoint);
> }
>
>
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira