Converting ZMTPMessage to String example

79 views
Skip to first unread message

Jonathan T

unread,
Jun 29, 2016, 4:34:47 PM6/29/16
to netty-zmtp
I'm trying to implement REQ/REP using your library and have been using the benchmark file as an example, but there doesn't seem to be an example of how to read the String (or raw data in general) that is received as the ZMTPMessage object since the channelRead implementation just fires back another request, ignoring the message from the REP server. An example of how best to do this would be appreciated since currently it seems like I would have to do: "String response = message.toString(message.write(ZMTPVersion.ZMTP20));" which seems a bit clunky and I'd imagine there may be a better way that I'm not seeing. Documenting whatever the best practice is for this in the README may be helpful to others in the future. Thanks.

Jonathan T

unread,
Jun 29, 2016, 5:13:58 PM6/29/16
to netty-zmtp
Just realized ZMTPMessage.toString(final ByteBuf data) has private access, so the example above isn't even viable (at least not without a reflection hack).
Reply all
Reply to author
Forward
0 new messages