Skip to content

feat(pekko-http-backend): add Pekko 2 artifact - #3065

Open
weiwen99 wants to merge 1 commit into
softwaremill:masterfrom
weiwen99:feat/pekko-http-2
Open

weiwen99 wants to merge 1 commit into
softwaremill:masterfrom
weiwen99:feat/pekko-http-2

Conversation

@weiwen99

@weiwen99 weiwen99 commented Nov 11, 2026 •

Copy link
Copy Markdown

Status

Pekko HTTP 2.0.0 has been released. This is ready for review.

What this adds

  • A separate pekko-http-backend-pekko2 artifact, because Pekko 2 is not binary compatible with Pekko 1.x.
  • The existing pekko-http-backend artifact is unchanged and remains on Pekko 1.4.2.
  • The new module reuses the existing main and test sources.
  • Version-specific compat shims cover:
    • watchTermination() → watchTermination in Pekko 2.
    • The changed Route.seal signature; Route.toFunction is used in both versions.
  • The new artifact is published for Scala 2.13 and 3, and targets Java 17+ (Pekko 2 requirements). It is not published for Scala 2.12.
  • The package and imports are unchanged (sttp.client4.pekkohttp), so downstream users only change the dependency.
  • The module is added to rawAllAggregates, so compileScoped / testScoped picks it up.
  • Docs: new artifact, support matrix, and Pekko 2 notes.

Testing

  • pekko2HttpBackend/testOnly sttp.client4.pekkohttp.* — 163/163 (Scala 3.9, Pekko HTTP 2.0.0).
  • pekko2HttpBackend2_13/testOnly sttp.client4.pekkohttp.* — 163/163 (Scala 2.13, Pekko HTTP 2.0.0).
  • pekkoHttpBackend/testOnly sttp.client4.pekkohttp.* (existing Pekko 1 module) — 163/163.
  • scalafmtSbtCheck and both backend scalafmtCheck tasks pass.
  • Both Scala versions emit Java 17 bytecode (class file major version 61).

Notes

  • Pekko 2 deprecates the Source.queue(bufferSize, OverflowStrategy) overload. This PR keeps it for now to preserve the existing WebSocket backpressure semantics. The replacement with BoundedSourceQueue / actorRefWithBackpressure is a follow-up; the deprecated overload remains functional in Pekko HTTP 2.0.0.
  • Pekko 2 exposes some connect-time failures as the internal OutgoingConnectionBlueprint$UnexpectedConnectionClosureException. Since that class is not accessible from user code, FromPekko maps it to SttpClientException.ConnectException by class name. This fixes the unknown host exception test.
  • sttp.shared's pekko module is type-only and remains usable with Pekko 2; this PR does not change it.
  • The new artifact pins Pekko HTTP 2.0.0 and Pekko Stream 2.0.0.

@weiwen99
weiwen99 marked this pull request as draft November 12, 2026 06:31
Add a separate pekko-http-backend-pekko2 artifact built against Pekko
HTTP 2.0.0 and Pekko Stream 2.0.0. Pekko 2 is not binary compatible
with Pekko 1.x, so the existing pekko-http-backend artifact remains on
Pekko 1.4.2.

The new module reuses the existing sources. Version-specific compat
shims cover watchTermination() -> watchTermination and the changed
Route.seal signature. The deprecated Source.queue overload is kept for
now to preserve WebSocket backpressure semantics.

The new artifact is published for Scala 2.13 and 3 and targets Java 17+.
Tests pass on Scala 2.13/3 (163/163), and the existing module remains
green on Scala 2.12/2.13/3 (163/163).
@weiwen99
weiwen99 marked this pull request as ready for review November 16, 2026 01:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant