[undertow-dev] Minor problem with UndertowSession#addMessageHandler(MessageHandler)

Andrej Golovnin golovnin at gmx.net
Mon Nov 4 15:30:07 EST 2013


Hi all,

there is a minor problem with the current implementation of 
UndertowSession#addMessageHandler(MessageHandler).

If we have the following MessageHandler implementation:

class MessageHandlerImpl implements Part<byte>, Whole<PongMessage> {

    public void onMessage(byte[] bytes, boolean last) {
    }

    public void onMessage(PongMessage pongMessage) {
    }

}

then only one of the #onMessage-methods would be added as
a message handler (s. FrameHandler#addHandler() and 
ClassUtils.getHandlerType() for details). The other is ignored. 

IMO the current Java WebSockets API spec does not prohibits
this kind of MessageHandler implementation.

Would you say it is a bug in Undertow?

Best regards,
Andrej Golovnin


More information about the undertow-dev mailing list