[ https://issues.apache.org/jira/browse/CAMEL-12068?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16281510#comment-16281510 ]
ASF GitHub Bot commented on CAMEL-12068: ---------------------------------------- oscerd closed pull request #2138: CAMEL-12068: Enable http2 for undertow component URL: https://github.com/apache/camel/pull/2138 This is a PR merged from a forked repository. As GitHub hides the original diff on merge, it is displayed below for the sake of provenance: As this is a foreign pull request (from a fork), the diff is supplied below (as it won't show otherwise due to GitHub magic): 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 89447efbd94..4ef6126c0ed 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 @@ 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 synchronized void registerHandler(HttpHandlerRegistrationInfo registratio 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 String toString() { } 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 fb50ba945e1..81933c96fe2 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 @@ * 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 void setDirectBuffers(Boolean directBuffers) { 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 String toString() { 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 ce3df2dead1..8a179c3e951 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 void setResolvePropertyPlaceholders( * 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 Boolean getDirectBuffers() { 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 ---------------------------------------------------------------- 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: us...@infra.apache.org > Camel Undertow support for http2 > -------------------------------- > > Key: CAMEL-12068 > URL: https://issues.apache.org/jira/browse/CAMEL-12068 > Project: Camel > Issue Type: Improvement > Components: camel-undertow > Affects Versions: 2.21.0 > Environment: ALL > Reporter: chandra shekhar pandey > Assignee: Andrea Cosentino > Fix For: 2.21.0 > > > Camel Undertow seems to be supporting only http1.1 currently. As embedded > undertow version is 1.4 which supports http2, hence camel-undertow consumer > should also support http2 protocol. -- This message was sent by Atlassian JIRA (v6.4.14#64029)