Skip to content

feat: add HttpExtension SPI for pluggable HTTP endpoints - #15

Open
liudezhi2098 wants to merge 4 commits into
branch-as-4.18from
feat/http-extension-spi
Open

feat: add HttpExtension SPI for pluggable HTTP endpoints#15
liudezhi2098 wants to merge 4 commits into
branch-as-4.18from
feat/http-extension-spi

Conversation

@liudezhi2098

@liudezhi2098 liudezhi2098 commented Jun 16, 2026

Copy link
Copy Markdown

Motivation

The HTTP server in BookKeeper does not currently provide a way for external components to register custom HTTP endpoints. This makes it difficult to extend the HTTP API without modifying core code.

Changes

  • Add HttpExtension SPI interface for registering pluggable HTTP endpoints
  • Add HttpEndpoint interface to describe path, supported methods, and handler service
  • Update VertxHttpServer to load and register extensions via setHttpExtensionClasses()
  • Add TestVertxHttpServerExtension to cover extension registration and routing behavior

Introduce HttpExtension interface and HttpEndpoint value object to allow
loading custom HTTP endpoints via SPI. Extensions are configured through
the httpExtensions server config parameter and loaded at startup by
VertxHttpServer via reflection.
- TestVertxHttpServerExtension: 7 tests covering SPI loading,
  method restriction, invalid path skipping, graceful class-not-found,
  no-extensions regression, and multi-endpoint registration
- TestServerConfiguration: 4 tests for httpExtensions getter/setter,
  default null, empty array behavior, and chainable setter
- VertxHttpServer: minor style fix (expand single-line if blocks)
@liudezhi2098 liudezhi2098 changed the title Feat/http extension spi feat: add HttpExtension SPI for pluggable HTTP endpoints Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant