[
https://issues.apache.org/jira/browse/CAMEL-12462?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16453556#comment-16453556
]
ASF GitHub Bot commented on CAMEL-12462:
----------------------------------------
davsclaus commented on a change in pull request #2302: CAMEL-12462
URL: https://github.com/apache/camel/pull/2302#discussion_r184280376
##########
File path:
components/camel-netty4-http/src/main/java/org/apache/camel/component/netty4/http/NettyHttpSendDynamicAware.java
##########
@@ -0,0 +1,40 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ * <p>
+ * http://www.apache.org/licenses/LICENSE-2.0
+ * <p>
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.netty4.http;
+
+import org.apache.camel.http.common.HttpSendDynamicAware;
+
+public class NettyHttpSendDynamicAware extends HttpSendDynamicAware {
+
+ @Override
+ protected String[] parseUri(DynamicAwareEntry entry) {
+ // camel-netty4 parses the uri a bit differently than
camel-http-common base class
+
+ String scheme = entry.getProperties().get("protocol");
+ String host = entry.getProperties().get("host");
+ String port = entry.getProperties().get("port");
+ String path = entry.getProperties().get("path");
+
+ String s = scheme + "://" + host;
Review comment:
Yeah any name is better than `s`.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> toD with HTTP endpoints - Optimise dynamic query to leverage HTTP_QUERY header
> ------------------------------------------------------------------------------
>
> Key: CAMEL-12462
> URL: https://issues.apache.org/jira/browse/CAMEL-12462
> Project: Camel
> Issue Type: Improvement
> Components: camel-core
> Reporter: Claus Ibsen
> Assignee: Claus Ibsen
> Priority: Major
> Fix For: 2.22.0
>
>
> We can consider for some HTTP components that support dynamic parts of their
> endpoints from Camel headers such as HTTP_QUERY and others.
> We can then in toD detect those components and then build a processor chain
> that does
> # setHeader - set dynamic header HTTP_QUERY
> # toD - call the endpoint with a more static uri
> This optimises to reuse the toD with more static uris, especially if you hit
> the same host for each toD and its only the query parameters that are dynamic.
> Today developers would need to use setHeader and to combo to do this, instead
> of a single toD.
> The trick is to separate the query parameters and the endpoint parameters and
> only set query parameters in the setHeader, and the endpoint parameters in
> toD.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)