This is an automated email from the ASF dual-hosted git repository. tabish pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/qpid-protonj2.git
The following commit(s) were added to refs/heads/main by this push: new 55b2738 Fixes issues with native transport selection and error message fix 55b2738 is described below commit 55b273839b8d1757a785cd7da2b65ea79544d3f7 Author: Timothy Bish <tabish...@gmail.com> AuthorDate: Fri Apr 30 12:40:40 2021 -0400 Fixes issues with native transport selection and error message fix --- .../protonj2/client/transport/NettyIOContext.java | 38 +++++++++++++--------- 1 file changed, 22 insertions(+), 16 deletions(-) diff --git a/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/transport/NettyIOContext.java b/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/transport/NettyIOContext.java index b52b5da..af79ed9 100644 --- a/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/transport/NettyIOContext.java +++ b/protonj2-client/src/main/java/org/apache/qpid/protonj2/client/transport/NettyIOContext.java @@ -64,24 +64,30 @@ public final class NettyIOContext { if (options.allowNativeIO()) { for (String nativeID : nativeIOPreference) { - if (EpollSupport.NAME.equalsIgnoreCase(nativeID) && EpollSupport.isAvailable(options)) { - LOG.trace("Netty Transports will be using Epoll mode"); - selectedGroup = EpollSupport.createGroup(1, threadFactory); - selectedChannelClass = EpollSupport.getChannelClass(); - break; - } else if (IOUringSupport.NAME.equalsIgnoreCase(nativeID) && IOUringSupport.isAvailable(options)) { - LOG.trace("Netty Transports will be using IO-Uring mode"); - selectedGroup = IOUringSupport.createGroup(1, threadFactory); - selectedChannelClass = IOUringSupport.getChannelClass(); - break; - } else if (KQueueSupport.NAME.equalsIgnoreCase(nativeID) && KQueueSupport.isAvailable(options)) { - LOG.trace("Netty Transports will be using KQueue mode"); - selectedGroup = KQueueSupport.createGroup(1, threadFactory); - selectedChannelClass = KQueueSupport.getChannelClass(); - break; + if (EpollSupport.NAME.equalsIgnoreCase(nativeID)) { + if (EpollSupport.isAvailable(options)) { + LOG.trace("Netty Transports will be using Epoll mode"); + selectedGroup = EpollSupport.createGroup(1, threadFactory); + selectedChannelClass = EpollSupport.getChannelClass(); + break; + } + } else if (IOUringSupport.NAME.equalsIgnoreCase(nativeID)) { + if (IOUringSupport.isAvailable(options)) { + LOG.trace("Netty Transports will be using IO-Uring mode"); + selectedGroup = IOUringSupport.createGroup(1, threadFactory); + selectedChannelClass = IOUringSupport.getChannelClass(); + break; + } + } else if (KQueueSupport.NAME.equalsIgnoreCase(nativeID)) { + if (KQueueSupport.isAvailable(options)) { + LOG.trace("Netty Transports will be using KQueue mode"); + selectedGroup = KQueueSupport.createGroup(1, threadFactory); + selectedChannelClass = KQueueSupport.getChannelClass(); + break; + } } else { throw new IllegalArgumentException( - String.format("Provided preferred native trasport type name: %s , is not vliad.", nativeID)); + String.format("Provided preferred native trasport type name: %s, is not supported.", nativeID)); } } } --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@qpid.apache.org For additional commands, e-mail: commits-h...@qpid.apache.org