Details
Description
When using Jetty BayeuxClient with registered MessageListener to listen for messages delivered by a server side bayeux instance an OutOffMemoryError occours. It seems to depend on the size of each message delivered from server to client via the bayeux protocol. I'll attach a sample, you can start the server instance an then client. Server will push messages of a given size to the client where the clients message listener will only print the message content to system.out.
Tobias,
I don't think this is really a bug. It looks like you are publishing a 600k message is a hard busy loop.
The client will subscribe and get the first of these big messages. While the long poll is processing, the
server will keep looping doing publishes and so on the next long poll, there will be several of these
messages queued. The client handles them as best it can, but takes longer, so on the next long poll
the queue is even bigger, so more messages get sent at once. This escalates until somebody
runs out of memory, which in this case appears to be the client.
I don't think the client is running incorrectly, it's just that you are asking it to handle tooo many big messages.
Note that cometd is probably not the best transport for large messages. It might be better to send a message
with a URL where the large content can be fetched from.
cheers
PS. if you think there is a real bug here, can you clarify your test harness and reopen (thanks for the test harness).