if (msg instanceof ChannelBuffer)
{
// this is ugly and slow!
// we have to go ChannelBuffer -> HornetQBuffer -> StompFrame -> String -> WebSocketFrame
// since HornetQ protocol SPI requires to return HornetQBuffer to the transport
HornetQBuffer buffer = new ChannelBufferWrapper((ChannelBuffer)msg);
StompFrame frame = decoder.decode(buffer);
if (frame != null)
{
WebSocketFrame wsFrame = new DefaultWebSocketFrame(frame.asString());