Tracking message delivery time

17 views
Skip to first unread message

Cosimo

unread,
Jul 1, 2019, 5:17:54 AM7/1/19
to cometd...@googlegroups.com
Hi,

I'm trying to understand what happens in a java cometd 4.0.3 server
from when I call the ServerSession#deliver() method to when it's received
on the client.

It seems that some clients are receiving comet messages later than they should,
so I'd like to understand what happens from deliver() onwards.

The first step I want to do is to log the time elapsed from the deliver()
call to when the successful promise callback is invoked, but what happens
after that? Are messages put in a queue? How can I log the timestamp
when messages are sent on the network?

On the client side (javascript), are there facilities to obtain a raw
traffic log of the comet messages without having access to the
webconsole?

Thanks,

--
Cosimo

Simone Bordet

unread,
Jul 1, 2019, 5:45:10 AM7/1/19
to cometd-users
Hi,

On Mon, Jul 1, 2019 at 11:17 AM Cosimo <cosi...@streppone.it> wrote:
>
> Hi,
>
> I'm trying to understand what happens in a java cometd 4.0.3 server
> from when I call the ServerSession#deliver() method to when it's received
> on the client.
>
> It seems that some clients are receiving comet messages later than they should,
> so I'd like to understand what happens from deliver() onwards.
>
> The first step I want to do is to log the time elapsed from the deliver()
> call to when the successful promise callback is invoked, but what happens
> after that? Are messages put in a queue?

Yes.

> How can I log the timestamp
> when messages are sent on the network?

Implement ServerSession.DeQueueListener and add it as a listener to the session.

When this listener is invoked, the queue is drained and then sent -
it's the last chance to get an event before the messages are passed to
the transport to be sent over the network.

> On the client side (javascript), are there facilities to obtain a raw
> traffic log of the comet messages without having access to the
> webconsole?

You can monkey patch function CometD._debug() (or Window.console).

--
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.

Cosimo

unread,
Jul 1, 2019, 7:50:08 AM7/1/19
to cometd...@googlegroups.com
On Mon, Jul 1, 2019, at 11:45, Simone Bordet wrote:
>
> On Mon, Jul 1, 2019 at 11:17 AM Cosimo <cosi...@streppone.it> wrote:
> >
> > How can I log the timestamp when messages are sent on the network?
>
> Implement ServerSession.DeQueueListener and add it as a listener to the session.

Thanks Simone, will try that.

--
Cosimo
Reply all
Reply to author
Forward
0 new messages