ramu11 commented on code in PR #27168:
URL: https://github.com/apache/camel/pull/27168#discussion_r4156204796


##########
components/camel-odata/src/main/java/org/apache/camel/component/odata/ODataProducer.java:
##########
@@ -0,0 +1,296 @@
+/*
+ * 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
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * 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.odata;
+
+import java.net.URI;
+import java.nio.charset.StandardCharsets;
+import java.util.Base64;
+import java.util.LinkedHashMap;
+import java.util.Map;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.Exchange;
+import org.apache.camel.Producer;
+import org.apache.camel.component.http.HttpConstants;
+import org.apache.camel.support.DefaultProducer;
+import org.apache.camel.support.MessageHelper;
+import org.apache.camel.support.jsse.SSLContextParameters;
+import org.apache.camel.support.service.ServiceHelper;
+import org.apache.camel.util.URISupport;
+
+public class ODataProducer extends DefaultProducer {
+
+    private final ODataEndpoint endpoint;
+    private Producer httpProducer;
+
+    public ODataProducer(ODataEndpoint endpoint) {
+        super(endpoint);
+        this.endpoint = endpoint;
+    }
+
+    @Override
+    protected void doStart() throws Exception {
+        super.doStart();
+
+        URI uri = endpoint.getHttpUri();
+        String httpUri = uri.toString();
+
+        if (httpUri.contains("?")) {
+            httpUri += "&throwExceptionOnFailure=true";
+        } else {
+            httpUri += "?throwExceptionOnFailure=true";
+        }
+
+        ODataConfiguration config = endpoint.getConfiguration();
+        Map<String, Object> httpParameters = new LinkedHashMap<>();
+
+        if (config != null) {
+            SSLContextParameters sslParams = 
endpoint.getSslContextParameters();
+            if (sslParams == null && 
endpoint.isUseGlobalSslContextParameters()) {
+                sslParams = 
endpoint.getCamelContext().getSSLContextParameters();
+            }
+            if (sslParams != null) {
+                httpParameters.put("sslContextParameters", sslParams);
+            }
+        }
+
+        Endpoint httpEndpoint = endpoint.getCamelContext()

Review Comment:
   Addressed in commit `c1a11055ded4`.
   
   The OData producer now creates a private HTTP endpoint using 
`Component.createEndpoint(...)` instead of `CamelContext.getEndpoint(uri, 
parameters)`, so HTTP endpoint caching cannot cause SSL parameters to be shared 
between OData endpoints.
   
   The private HTTP endpoint is also explicitly started and stopped with the 
OData producer lifecycle.
   
   Added a regression test covering two OData endpoints with the same 
underlying HTTPS URL, where one endpoint uses SSL trust-store parameters and 
the other does not. The configured endpoint succeeds, while the endpoint 
without SSL configuration fails, verifying that the TLS configuration is 
isolated.
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to