Closed PhilLehmann closed 6 years ago
it seems weird that unregister is not listed in the protocol : https://github.com/vert-x3/vertx-tcp-eventbus-bridge
@pmlopes why don't we have an unregister frame in the protocol ?
It's listed below "Messages from the client -> bridge".
ah right I only see "register" and did not read the second one.
the first issue is that behavior is not tested in the tests of this project.
then I think we should simple add an "unregister" case in the switch statement and handle it properly
Makes sense. I'll PR.
great!
Could you merge the existing PR and put the regression test up for grabs for someone who already wrote tests for this project? We could leave this issue open.
where is the regression test @philrykoff ?
That's why I asked to put it up for grabs... the test framework is different from eventbus-clients, e.g. Thread.sleep throws exceptions. I'd like for someone else to add a test.
ok
Looks like this is fixed with #39, isn't it?
Indeed, thanks!
Version
Context
While unregistering a consumer, vertx-eventbus-bridge-clients fails:
Unhandled exception java.lang.IllegalArgumentException: Invalid frame type unregister at io.vertx.ext.eventbus.bridge.tcp.impl.TcpEventBusBridgeImpl.parseType(TcpEventBusBridgeImpl.java:409) at io.vertx.ext.eventbus.bridge.tcp.impl.TcpEventBusBridgeImpl.lambda$handler$8(TcpEventBusBridgeImpl.java:252) at io.vertx.ext.eventbus.bridge.tcp.impl.protocol.FrameParser.handle(FrameParser.java:67) at io.vertx.ext.eventbus.bridge.tcp.impl.protocol.FrameParser.handle(FrameParser.java:30) at io.vertx.core.net.impl.NetSocketImpl$DataMessageHandler.handle(NetSocketImpl.java:384) at io.vertx.core.net.impl.NetSocketImpl.handleMessageReceived(NetSocketImpl.java:351) at io.vertx.core.net.impl.NetServerImpl$2.handleMessage(NetServerImpl.java:446) at io.vertx.core.net.impl.NetServerImpl$2.handleMessage(NetServerImpl.java:443) at io.vertx.core.net.impl.VertxHandler.lambda$channelRead$1(VertxHandler.java:146) at io.vertx.core.impl.ContextImpl.lambda$wrapTask$2(ContextImpl.java:337) at io.vertx.core.impl.ContextImpl.executeFromIO(ContextImpl.java:195) at io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:144) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1359) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:935) at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:134) at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:645) at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:580) at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:497) at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:459) at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:858) at java.lang.Thread.run(Thread.java:745)
Extra
In 3.4.2, a PING message was detected with
https://github.com/philrykoff/vertx-tcp-eventbus-bridge/blob/3.4.2/src/main/java/io/vertx/ext/eventbus/bridge/tcp/impl/TcpEventBusBridgeImpl.java
In the current version, the method
parseType
has been added for detecting PING messages. But it currently only allows for four message types:We have two options:
I would make this dependant on whether you would like to use parseType anywhere else in this project. If it will just be used for pings, I would fall back.
Opinions?