Pavel Zdenek wrote:
Greetings fellow min(a)ers!
I understand the controversy over messageSent, because the "feature"
of firing twice per each actual object being encoded is annoying me as
well. Anyway, i do need such sort of event information in my current
pet project, something has to happen in the persistent layer after the
message delivery is confirmed. Unfortunately, the most recommended
hack solution with waiting on WriteFuture is neither applicable,
because i do physically send out a multiple IoBuffers for each
abstract message written. I need to get the messageSent on the last
one, not the first one (as it happens now). I am thinking about
setting up a wait condition after session.write and signalling it from
the correct messageSent. But i am too unfamiliar with the threading
model of Mina, to say whether it's a good idea. Somebody with better
understanding say?
The way it works is that each 'message' is enqueued until it's sent.
Then a MessageSent event is generated. Sadly, we don't associate a umber
with each message, so it's difficult to correlate a MessageSent event
with a given message, except that AFAIR, the IoBuffer is present in the
messageSent event.
If so, you may be able to compare the message content with what you know
to be the last message sent (you can store it in the session for
instance). This is from the top of my head...
In 3.0, it would be really a good idea to add an incremental per session
message number to deal with such cases...
--
--
cordialement, regards,
Emmanuel Lécharny
www.iktek.com
directory.apache.org