You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by lb...@apache.org on 2020/03/25 15:37:47 UTC

[camel-k-runtime] branch master updated (c808cf2 -> de17d39)

This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git.


    from c808cf2  Cleanup kotlin loader
     new b431294  knative-transport-http: warn if host or port are configured for sources
     new de17d39  knative-transport-http: remove redundant class

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 .../camel/component/knative/http/KnativeHttp.java  | 25 ----------------------
 .../knative/http/KnativeHttpConsumer.java          |  9 +++++++-
 .../knative/http/KnativeHttpProducer.java          |  6 +++---
 .../knative/http/KnativeHttpTransport.java         |  3 +++
 4 files changed, 14 insertions(+), 29 deletions(-)
 delete mode 100644 camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttp.java


[camel-k-runtime] 02/02: knative-transport-http: remove redundant class

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit de17d39a96c982302bc31423f946db0c0eb903c4
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Mar 25 15:28:30 2020 +0100

    knative-transport-http: remove redundant class
---
 .../camel/component/knative/http/KnativeHttp.java  | 25 ----------------------
 .../knative/http/KnativeHttpConsumer.java          |  2 +-
 .../knative/http/KnativeHttpProducer.java          |  6 +++---
 .../knative/http/KnativeHttpTransport.java         |  3 +++
 4 files changed, 7 insertions(+), 29 deletions(-)

diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttp.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttp.java
deleted file mode 100644
index a7d83d3..0000000
--- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttp.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * 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.knative.http;
-
-public final class KnativeHttp {
-    public static final int DEFAULT_PORT = 8080;
-    public static final String DEFAULT_PATH = "/";
-
-    private KnativeHttp() {
-    }
-}
diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java
index 09d5a4f..810abcc 100644
--- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java
+++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java
@@ -93,7 +93,7 @@ public class KnativeHttpConsumer extends DefaultConsumer {
         }
 
         if (route == null) {
-            String path = ObjectHelper.supplyIfEmpty(serviceDefinition.getPath(), () -> KnativeHttp.DEFAULT_PATH);
+            String path = ObjectHelper.supplyIfEmpty(serviceDefinition.getPath(), () -> KnativeHttpTransport.DEFAULT_PATH);
             if (ObjectHelper.isNotEmpty(basePath)) {
                 path = basePath + path;
             }
diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
index 1e1b7ab..d7e696e 100644
--- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
+++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpProducer.java
@@ -111,8 +111,8 @@ public class KnativeHttpProducer extends DefaultAsyncProducer {
             return true;
         }
 
-        final int port = serviceDefinition.getPortOrDefault(KnativeHttp.DEFAULT_PORT);
-        final String path = serviceDefinition.getPathOrDefault(KnativeHttp.DEFAULT_PATH);
+        final int port = serviceDefinition.getPortOrDefault(KnativeHttpTransport.DEFAULT_PORT);
+        final String path = serviceDefinition.getPathOrDefault(KnativeHttpTransport.DEFAULT_PATH);
 
         client.post(port, serviceDefinition.getHost(), path)
             .putHeaders(headers)
@@ -181,7 +181,7 @@ public class KnativeHttpProducer extends DefaultAsyncProducer {
     }
 
     private String getURI() {
-        String p = ObjectHelper.supplyIfEmpty(serviceDefinition.getPath(), () -> KnativeHttp.DEFAULT_PATH);
+        String p = ObjectHelper.supplyIfEmpty(serviceDefinition.getPath(), () -> KnativeHttpTransport.DEFAULT_PATH);
         if (!p.startsWith("/")) {
             p = "/" + p;
         }
diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpTransport.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpTransport.java
index aa15464..9e7eb51 100644
--- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpTransport.java
+++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpTransport.java
@@ -30,6 +30,9 @@ import org.apache.camel.k.http.PlatformHttp;
 import org.apache.camel.support.service.ServiceSupport;
 
 public class KnativeHttpTransport extends ServiceSupport implements CamelContextAware, KnativeTransport {
+    public static final int DEFAULT_PORT = 8080;
+    public static final String DEFAULT_PATH = "/";
+    
     private PlatformHttp platformHttp;
     private WebClientOptions vertxHttpClientOptions;
     private CamelContext camelContext;


[camel-k-runtime] 01/02: knative-transport-http: warn if host or port are configured for sources

Posted by lb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

lburgazzoli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k-runtime.git

commit b431294511f76216a2a8f81fe9a24a186fb8dcfa
Author: lburgazzoli <lb...@gmail.com>
AuthorDate: Wed Mar 25 14:21:48 2020 +0100

    knative-transport-http: warn if host or port are configured for sources
---
 .../apache/camel/component/knative/http/KnativeHttpConsumer.java   | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java
index d8d3688..09d5a4f 100644
--- a/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java
+++ b/camel-knative/camel-knative-http/src/main/java/org/apache/camel/component/knative/http/KnativeHttpConsumer.java
@@ -85,6 +85,13 @@ public class KnativeHttpConsumer extends DefaultConsumer {
 
     @Override
     protected void doStart() throws Exception {
+        if (!ObjectHelper.isEmpty(serviceDefinition.getHost())) {
+            LOGGER.warn("Unsupported property `host` on definition={}", serviceDefinition.getName());
+        }
+        if (serviceDefinition.getPort() >= 0) {
+            LOGGER.warn("Unsupported property `port` on definition={}", serviceDefinition.getName());
+        }
+
         if (route == null) {
             String path = ObjectHelper.supplyIfEmpty(serviceDefinition.getPath(), () -> KnativeHttp.DEFAULT_PATH);
             if (ObjectHelper.isNotEmpty(basePath)) {