如何在使用 gzip 服务器时禁用 DropWizard 中的管理端口 mode/type

How to disable admin port in DropWizard while using gzip server mode/type

我试图在使用 'gzip' 服务器模式时禁用 DropWizard 中的管理端口。 我知道这在 'simple' 服务器中是可能的。下面是 .yml 文件配置。 -

server:
  type: simple

但我想在 gzip 服务器模式下禁用管理端口。

server:
  gzip:
    bufferSize: 8KiB

注意:我不能使用 'simple' 服务器,因为我们依赖于 'gzip'。 我现在没有想法,非常感谢任何帮助。

默认的 Dropwizard 配置包括一个管理连接器。为防止这种情况,您需要明确告诉它不要包含任何管理连接器:

server:
  gzip:
    bufferSize: 8KiB
  adminConnectors: []