Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jetty-users] Dumping the headers

Many thanks you for the answer... some more questions follow...

> I'm not sure about the exact meaning of setDelayDispatchUntilContent. It's
> documented 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 be
> done, until they're fully available. Am I right?
No, it means to wait to call the application until the first chunk of
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 trade 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
> it for my statistics.
Yes. If you only need the request start time you can call
Request.getTimeStamp().
Otherwise I suggest you use the more generic HttpChannel.Listener mechanism:
ServerConnector connector = ...;
connector.addBean(new HttpChannel.Listener() {
  @Override
  public void onRequestBegin(Request request) {
    ...
  }
});
which exposes many more events.

Nice!

Regards,
Martin.


Back to the top