Skip to content

Remove fanout publisher sink wrapper#3176

Open
He-Pin wants to merge 2 commits into
apache:mainfrom
He-Pin:chore/direct-fanout-publisher-bridge
Open

Remove fanout publisher sink wrapper#3176
He-Pin wants to merge 2 commits into
apache:mainfrom
He-Pin:chore/direct-fanout-publisher-bridge

Conversation

@He-Pin

@He-Pin He-Pin commented Jun 24, 2026

Copy link
Copy Markdown
Member

Motivation

Refs #2860 tracks converting old stream internals to GraphStages. After the fanout publisher runtime moved to FanoutPublisherBridgeStage, Sink.asPublisher(fanout = true) still kept FanoutPublisherSink as an internal SinkModule wrapper.

Modification

  • Build the fanout publisher sink directly from Flow[T].async and FanoutPublisherBridgeStage.
  • Delete the remaining FanoutPublisherSink wrapper.
  • Add a MiMa filter for the removed internal class.

Result

The fanout publisher path now composes directly from the GraphStage bridge while preserving the async/request boundary covered by the existing fanout and FlowSpec tests. The public Sink.asPublisher API is unchanged.

Tests

  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.impl.FanoutPublisherBehaviorSpec" - passed
  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.scaladsl.PublisherSinkSpec org.apache.pekko.stream.scaladsl.SinkSpec org.apache.pekko.stream.scaladsl.FlowSpec org.apache.pekko.stream.impl.TimeoutsSpec" - passed
  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests-tck / Test / testOnly org.apache.pekko.stream.tck.FanoutPublisherTest" - passed
  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream / mimaReportBinaryIssues" - passed
  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt headerCreateAll - passed
  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "+headerCheckAll" - passed
  • rtk scalafmt --list --mode diff-ref=origin/main - passed
  • rtk git diff --check - passed
  • rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt validatePullRequest - not completed locally: JournalNoCompactionSpec hit macOS ARM64 leveldbjni native library incompatibility (libleveldbjni contains x86_64/i386, needs arm64); command was stopped after the environment failure
  • Qoder stdout review with /tmp/project-review.diff attachment - No must-fix findings (/tmp/project-qoder-review.log)

References

Refs #2860

Motivation:
Issue apache#2860 tracks moving stream internals away from old infrastructure. Sink.asPublisher(fanout = true) still kept an internal SinkModule wrapper around the GraphStage fanout publisher bridge.

Modification:
Build the fanout publisher sink directly from Flow.async and FanoutPublisherBridgeStage, preserving the async boundary while deleting FanoutPublisherSink. Add a MiMa filter for the removed internal class.

Result:
The fanout publisher path no longer needs a dedicated SinkModule wrapper, while the public Sink.asPublisher API remains unchanged.

Tests:
- rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.impl.FanoutPublisherBehaviorSpec" - passed
- rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests / Test / testOnly org.apache.pekko.stream.scaladsl.PublisherSinkSpec org.apache.pekko.stream.scaladsl.SinkSpec org.apache.pekko.stream.scaladsl.FlowSpec org.apache.pekko.stream.impl.TimeoutsSpec" - passed
- rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream-tests-tck / Test / testOnly org.apache.pekko.stream.tck.FanoutPublisherTest" - passed
- rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "stream / mimaReportBinaryIssues" - passed
- rtk env JAVA_HOME=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home PATH=/Users/hepin/Library/Java/JavaVirtualMachines/azul-17.0.17/Contents/Home/bin:$PATH sbt "+headerCheckAll" - passed
- rtk scalafmt --list --mode diff-ref=origin/main - passed
- rtk git diff --check - passed

References:
Refs apache#2860
@He-Pin He-Pin marked this pull request as draft June 24, 2026 20:17
Motivation:
All other .excludes files in stream/src/main/mima-filters/
2.0.x.backwards.excludes/ carry the standard Apache 2.0 header;
the newly added remove-fanout-publisher-sink.excludes did not.

Modification:
Prepend the 16-line license block to match neighboring files.

Result:
Directory consistency with the established license-header convention.

Tests:
Not run - docs only (MiMa filter is metadata, not executable code).

References:
Refs apache#3176
@He-Pin He-Pin marked this pull request as ready for review June 26, 2026 22:21
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