Lost Messages


#1

I am developing a custom database application. I receive data from network around 300 packets per second. After I insert the incoming data the database classes sends an ActionMessage to GUI classes (actually to RecordSet class of the GUI component). Under load some of the messages are lost. When I open a new form I see the full set of database records, but the previously opened form shows as half of the records. For some forms (the Clock) I was using ChangeBroadcaster and I had to change it to ActionBroadcaster for the same reason. It is worst for ChangeBroadcaster, when it looses the messages, naturally it never fires again.


#2

Your ActionListenerList posts a message for each listener on the list. I normallly have 10 forms listening to 300 packets which makes 3000 messages per second.

How about sending 1 message from ActionListenerList and at “handleMessage” send the message to list members?


#3

First of all, it’s “LOSE”, not “LOOSE”!!! :roll: Drives me mad when I see people do that one!

The whole point of a ChangeListener is that it throws away duplicate messages - did you just mis-understand how it works, or are you actually overflowing your message-thread? Obviously if you suddenly post 10000 messages before allowing any of them to get processed, then the OS will start chucking them away - and that’s only to be expected.

Doesn’t sound like you even need a message per item though - surely some records arrive, you send a single change message, and then at some point later, the UI updates itself to show all the ones that are new to it.


#4

Pardon me for “loose” :slight_smile:

I know that changeListener throws away duplicates and waits for the single message that it posts to MessageManager, but when that single message is somewhat lost, it never (naturally) fires again.

I implemented a new ActionListenerList as I proposed, and testing it now.


#5

But if you’re only sending a reasonable number of messages, it should never get lost. At least, I’ve never seen a message get lost in my apps before - you’d need to really hammer it for that to happen.


#6