Martin Grajcar
2017-12-20 08:39:56 UTC
Many thanks you for the answer... some more questions follow...
the stream for a byte[] anytime. I guess, there's no out of the box
solution for this and I need to use request.startAsync, right?
Slightly related: Can I get the headers as text just like they were sent? I
want to do a full dump of some requests and dumping exactly what arrived
would be best.
Regards,
Martin.
I'm not sure about the exact meaning of setDelayDispatchUntilContent. It's
content, if any, is available.
This is done because typically the first thing that applications do is
to read the content, and there would be no point in calling the
application to have it block because there is no content available
yet.
Actually, my application always needs the *full* content. I'd gladly tradedocumented with
Whether to delay the application dispatch until content is available
which may mean it waits until all or some content is available.
I guess, it means the former, as with many requests, nearly nothing can
beWhether to delay the application dispatch until content is available
which may mean it waits until all or some content is available.
I guess, it means the former, as with many requests, nearly nothing can
done, until they're fully available. Am I right?
No, it means to wait to call the application until the first chunk ofcontent, if any, is available.
This is done because typically the first thing that applications do is
to read the content, and there would be no point in calling the
application to have it block because there is no content available
yet.
the stream for a byte[] anytime. I guess, there's no out of the box
solution for this and I need to use request.startAsync, right?
Slightly related: Can I get the headers as text just like they were sent? I
want to do a full dump of some requests and dumping exactly what arrived
would be best.
Anyway, is it possible to obtain the time when the request started? I'd
need
Request.getTimeStamp().
Otherwise I suggest you use the more generic HttpChannel.Listener
ServerConnector connector = ...;
connector.addBean(new HttpChannel.Listener() {
@Override
public void onRequestBegin(Request request) {
...
}
});
which exposes many more events.
Nice!need
it for my statistics.
Yes. If you only need the request start time you can callRequest.getTimeStamp().
Otherwise I suggest you use the more generic HttpChannel.Listener
ServerConnector connector = ...;
connector.addBean(new HttpChannel.Listener() {
@Override
public void onRequestBegin(Request request) {
...
}
});
which exposes many more events.
Regards,
Martin.