Upgrading Jetty 8 to Jetty 9

前端 未结 1 403
野趣味
野趣味 2021-01-23 20:49

I am upgrading from jetty 8 to jetty 9 and have come across some issues around compilation failures within some APIs.

The SslSelectChannelConnector has been removed a

相关标签:
1条回答
  • 2021-01-23 21:09

    Reminder: Jetty versioning (since 1995) is <servlet_support>.<major_version>.<minor_version>

    You are doing a major version upgrade from 8.1 to 9.4 (which is 6 major versions!). You are seeing a massive amount of change as a result of this.

    The SslSelectChannelConnector has been removed and from what I can see httpConfiguration with secureRequestCustomizer replaces this.

    Welcome to the new world of protocols.

    There is no longer any concept of protocol specific connectors.

    ServerConnector is the connector, it has no protocol knowledge, nor needs it. It simply is a connection point (not even TCP/IP specific, it could be Unix Sockets for example) to the server.

    The configuration of it, determines the connection type, where it binds, and how the protocol is negotiated once the client connects to that port.

    The ConnectionFactory determines that.

    The HttpConfiguration determines how the HTTP level behavior functions.

    See: https://stackoverflow.com/a/30191878/775715 for description.

    See: embedded-jetty examples of this is use. Start with LikeJettyXml.java.

    See: embedded-jetty-cookbook for more examples.

    But there are many methods that I cant find on both. For example

    setRequestBufferSize

    This doesn't exist anymore, it was incompatible with SPDY and HTTP/2

    See HttpConfiguration.setRequestHeaderSize(int) for controlling the maximum request header size.

    Note: If you are using HTTP/2, we would recommend that you do not adjust the request header size to be bigger then default (for protocol compatibility reasons).

    setResponseBufferSize

    This doesn't exist anymore, it was incompatible with SPDY and HTTP/2.

    See HttpConfiguration.setResponseHeaderSize(int) for controlling the maximum response header size.

    Note: If you are using HTTP/2, we would recommend that you do not adjust the response header size to be bigger then default (for protocol compatibility reasons).

    See HttpConfiguration.setOutputBufferSize(int) for output buffer aggregation controls. (has little meaning in HTTP/2, is really only relevant for HTTP/1.x)

    setAcceptors

    See the various constructors for ServerConnector, there are no setters for these.

    setMaxIdleTime

    There are many idle timeout settings available to you (eg: connector, connection, endpoint, thread, threadpool, AsyncContext, read, write, websocket session, etc ...)

    Here's a few examples that seem relevant based on your questions.

    See ServerConnector.setIdleTimeout(long)

    See HttpConfiguration.setIdleTimeout(long)

    See QueuedThreadPool.setIdleTimeout(int)

    SessionHandler no longer has a getSessionManager() method.

    The Session Handling has undergone even greater change over the past 6 major version updates then the connectors.

    See: OneServletContextWithSession.java

    Also the queueThreadPool no longer has a setMaxQueued(int ), and JettyServer no longer has these two methods: setThreadPool(QueueThreadPool) setGracefulShutdown(int)

    The configuration for min/max in QueuedThreadPool are part of the Constructors. There are no setters for min/max.

    To configure the Server thread pool, use the constructors that allow you to pass in a Thread Pool.

    Note: If you are using HTTP/2, with html/css/javascript we would recommend that you plan for increased thread pool demand (due to the nature of the protocol)

    0 讨论(0)
提交回复
热议问题