On Mon, Jul 29, 2013 at 11:52 AM, Ashish <paliwalash...@gmail.com> wrote: > On Mon, Jul 29, 2013 at 3:15 PM, Julien Vermillard > <jvermill...@gmail.com>wrote: > >> On Sun, Jul 28, 2013 at 4:20 PM, Ashish <paliwalash...@gmail.com> wrote: >> > On Sun, Jul 28, 2013 at 5:18 PM, Julien Vermillard < >> jvermill...@gmail.com>wrote: >> > >> >> Hi, >> >> Just make a filter handling read,but bypass for write >> >> and a filter handling write but bypass for read. >> >> >> >> If you extends AbstractIoFilter you just need to implement the needed >> >> event for each filter. >> >> >> >> >> > Got it.. Did we dropped the idea of having different filter chains for >> > read/write? >> > >> >> Yes, for the sake of simplicity: most of time if you transform in one >> way, you need to do >> it in the other way. >> > > I might have missed the discussion for this. I am getting older :) > What about the order in which it would be executed? Is it same as added in > chain like in MINA 2.0 or the other way round.
The order is the same as MINA 2: read/open/close/idle/exception left to right, write right to left. > > We also need an example with Codecs. Would you have bandwidth to create one? You have the CoAP codec for a datagram based codec (no accumulation). I'm working on a MQTT codec :https://github.com/jvermillard/mqtt-experiment/tree/master/mqtt-codec/ but this one is a state machine with no accumulation, it's quite tedious to understand. You are right, some simpler example is needed, probably using IoBuffer for accumulation. I'm not sure I'm willing to do it in the next days :) >> >> By the way, after implementing a lot of protocols using mina, I learnt >> something about IoFilter: >> too much logic in IoFilters is a design smell. Each time I try to do >> that it's ending in a big refactoring for putting this logic in the >> IoHandler :) >> > > Avro codec is light, just want to understand the flow correctly to get a > working example. The real PITA is when from a filter read event you want to write a message, using session.write(..) in a read message handling. And you are intermixing read chain walk with a walk of the write chain. It can raise some weird question like : do I partially bypass the write filter in the end of the filter chain? Julien