May I upstream self-created messages?

Daniel Ferber dffforum at gmail.com
Tue Aug 24 13:29:24 EDT 2010


Hi Bruno, thanks for your valuable advice.

Regarding the first approach, do I need to create a new event? I think I may
use MessageEvent to send my pojo upstream (to the business handler that
knows how to handle it). From the documentation I understood that my handler
may fire upstream any number of events created by itself. A received message
may be decoded and split into several messages to be fired upstream. Of
course, I have to be consistent: eg. prevent firing a spurious content
message after the channel has been disconnected. There I see the advantage
of declaring my own event type: it is less error prone since it prevents
confusion with other events defined by Netty.

But I liked more your second approach. It is simpler but more flexible. It
does not mess up the protocol nor does it require additional events (or
messages) that complicate the state machine for the business handler. So
obvious... but I was not able to workout the idea by myself.

-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/May-I-upstream-self-created-messages-tp5457151p5457929.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list