0 Replies Latest reply on Mar 7, 2018 8:11 AM by gabriel_popescu

    Wildfly JMS Client with Netty 4.1

    gabriel_popescu

      Hi,

       

      We have Wildfly 8.1 installed.

      I'm writing an application which reads JMS messages and calls a remote procedure using gRPC.

      Basically, for Wildfly I have this dependency in Maven:

       

      <dependency>

         <groupId>org.wildfly</groupId>

         <artifactId>wildfly-jms-client-bom</artifactId>

         <version>8.1.0.Final</version>

         <type>pom</type>

      </dependency>

       

      And for gRPC, along other:

      <dependency>

         <groupId>io.grpc</groupId>

         <artifactId>grpc-netty</artifactId>

         <version>1.10.0</version>

      </dependency>

       

      I realised they don't work together - depending on which dependency is first in the POM, either JMS or gRPC work, but not both.

      After several tests which basically consisted in Maven manual exclusions/inclusions, I concluded (hopefully right) that the problem is that gRPC and Wildfly's JMS both use Netty.

      • Wildfly uses netty-all 4.0.15, gRPC only 2 specific artefacts: netty-handler-proxy and netty-codec-http2
      • netty-all 4.0.15 doesn't contain the 2 specific artefacts; still, somehow they are confused by this version of netty-all.
      WARNING: [io.grpc.internal.ManagedChannelImpl-1] Unexpected exception from LoadBalancer
      java.lang.NoSuchMethodError: io.netty.handler.codec.http.HttpResponseStatus.codeAsText()Lio/netty/util/AsciiString;
      • netty-all 4.1.x contains also the 2 artefacts, but Wildfly doesn't work anymore
      javax.jms.JMSException: Failed to create session factory
      at org.hornetq.jms.client.HornetQConnectionFactory.createConnectionInternal(HornetQConnectionFactory.java:673) ~[hornetq-jms-client-2.4.1.Final.jar:na]
      at org.hornetq.jms.client.HornetQConnectionFactory.createConnection(HornetQConnectionFactory.java:112) ~[hornetq-jms-client-2.4.1.Final.jar:na]

       

      I didn't know whether to post this here or on gRPC's forum, but considering gRPC seems to work with the latest Netty and Wildfly doesn't I chose this forum

      Is there anything I could do, maybe some other Wildfly artefact for reading JMS messages?

       

      Thank you!