msemys / esjc

EventStore Java Client
MIT License
108 stars 27 forks source link

esjc:2.0.0 co-existing with elastic transport-netty4-client #37

Open andreasBerre opened 6 years ago

andreasBerre commented 6 years ago

I've experienced problems if esjc and elastics netty client are initialized in the same jvm; esjc fails with the exception below on appending events to a stream. Disabling the elastic client (while keeping the dependencies) fixes the problem.

Any ideas?

Caused by: java.lang.IllegalArgumentException: Unsupported TCP command 21
    at com.github.msemys.esjc.tcp.TcpCommand.of(TcpCommand.java:93)
    at com.github.msemys.esjc.tcp.TcpPackage.of(TcpPackage.java:77)
    at com.github.msemys.esjc.tcp.TcpPackageDecoder.decode(TcpPackageDecoder.java:16)
    at com.github.msemys.esjc.tcp.TcpPackageDecoder.decode(TcpPackageDecoder.java:9)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:88)
    ... 20 more
        <dependency>
            <groupId>com.github.msemys</groupId>
            <artifactId>esjc</artifactId>
            <version>2.0.0</version>
        </dependency>
        <dependency>
           <groupId>org.elasticsearch.plugin</groupId>
           <artifactId>transport-netty4-client</artifactId>
           <version>6.1.3</version>
         </dependency>
andreasBerre commented 6 years ago

nvm, solved by shading netty in the esjc artifact.