camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acosent...@apache.org
Subject [camel] 02/02: CAMEL-12068: Enable http2 for undertow component
Date Thu, 07 Dec 2017 08:49:05 GMT
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit b305eed1af4824355f9e9ee98fd7899e13b4d071
Author: cpandey <chandrashekharpandey@hotmail.com>
AuthorDate: Wed Dec 6 21:51:48 2017 +0530

    CAMEL-12068: Enable http2 for undertow component
---
 .../camel/component/undertow/DefaultUndertowHost.java    |  6 +++++-
 .../camel/component/undertow/UndertowHostOptions.java    | 16 +++++++++++++++-
 .../springboot/UndertowComponentConfiguration.java       | 12 ++++++++++++
 3 files changed, 32 insertions(+), 2 deletions(-)

diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHost.java
b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHost.java
index 89447ef..4ef6126 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHost.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/DefaultUndertowHost.java
@@ -19,6 +19,7 @@ package org.apache.camel.component.undertow;
 import java.net.URI;
 
 import io.undertow.Undertow;
+import io.undertow.UndertowOptions;
 import io.undertow.server.HttpHandler;
 
 import org.apache.camel.component.undertow.handlers.CamelRootHandler;
@@ -76,6 +77,9 @@ public class DefaultUndertowHost implements UndertowHost {
                 if (options.getDirectBuffers() != null) {
                     builder.setDirectBuffers(options.getDirectBuffers());
                 }
+                if (options.getHttp2Enabled() != null) {
+                    builder.setServerOption(UndertowOptions.ENABLE_HTTP2, options.getHttp2Enabled());
+                }
             }
 
             undertow = builder.setHandler(rootHandler).build();
@@ -130,4 +134,4 @@ public class DefaultUndertowHost implements UndertowHost {
         }
         return hostString;
     }
-}
\ No newline at end of file
+}
diff --git a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
index fb50ba9..81933c9 100644
--- a/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
+++ b/components/camel-undertow/src/main/java/org/apache/camel/component/undertow/UndertowHostOptions.java
@@ -40,6 +40,11 @@ public final class UndertowHostOptions {
      * Set if the Undertow host should use direct buffers.
      */
     private Boolean directBuffers;
+    
+    /**
+     * Set if the Undertow host should use http2 protocol.
+     */
+    private Boolean http2Enabled;
 
     public UndertowHostOptions() {
     }
@@ -76,6 +81,14 @@ public final class UndertowHostOptions {
         this.directBuffers = directBuffers;
     }
 
+    public Boolean getHttp2Enabled() {
+        return http2Enabled;
+    }
+
+    public void setHttp2Enabled(Boolean http2Enabled) {
+        this.http2Enabled = http2Enabled;
+    }
+
     @Override
     public String toString() {
         final StringBuilder sb = new StringBuilder("UndertowHostOptions{");
@@ -83,8 +96,9 @@ public final class UndertowHostOptions {
         sb.append(", ioThreads=").append(ioThreads);
         sb.append(", bufferSize=").append(bufferSize);
         sb.append(", directBuffers=").append(directBuffers);
+        sb.append(", http2Enabled=").append(http2Enabled);
         sb.append('}');
         return sb.toString();
     }
 
-}
\ No newline at end of file
+}
diff --git a/platforms/spring-boot/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java
b/platforms/spring-boot/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java
index ce3df2d..8a179c3 100644
--- a/platforms/spring-boot/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java
+++ b/platforms/spring-boot/components-starter/camel-undertow-starter/src/main/java/org/apache/camel/component/undertow/springboot/UndertowComponentConfiguration.java
@@ -123,6 +123,10 @@ public class UndertowComponentConfiguration
          * Set if the Undertow host should use direct buffers.
          */
         private Boolean directBuffers;
+        /**
+         * Set if the Undertow host should use http2 protocol.
+         */
+        private Boolean http2Enabled;
 
         public Integer getWorkerThreads() {
             return workerThreads;
@@ -155,5 +159,13 @@ public class UndertowComponentConfiguration
         public void setDirectBuffers(Boolean directBuffers) {
             this.directBuffers = directBuffers;
         }
+
+        public Boolean getHttp2Enabled() {
+            return http2Enabled;
+        }
+
+        public void setHttp2Enabled(Boolean http2Enabled) {
+            this.http2Enabled = http2Enabled;
+        }
     }
 }
\ No newline at end of file

-- 
To stop receiving notification emails like this one, please contact
"commits@camel.apache.org" <commits@camel.apache.org>.

Mime
View raw message