pjfanning opened a new pull request, #3647:
URL: https://github.com/apache/pekko/pull/3647

   ### Motivation
   
   There is no way to create a materializer that applies a set of default 
attributes (for example a dispatcher, buffer sizes or a supervision strategy) 
to every stream it materializes. Today the attributes have to be put on each 
stream, or changed globally through configuration.
   
   ### Modification
   
   - Add `Materializer(contextProvider, defaultAttributes)` and 
`Materializer.createMaterializer(contextProvider, defaultAttributes)` for 
materializers bound to an actor context.
   - Add `Materializer(systemProvider, defaultAttributes)` and 
`Materializer.createMaterializer(systemProvider, defaultAttributes)` for system 
level materializers, backed by a new internal 
`SystemMaterializer.createAdditionalSystemMaterializer(Attributes)`.
   - Add a new internal `MaterializerGuardian.StartMaterializerWithAttributes` 
message. The existing `StartMaterializer` case object is unchanged.
   - The given attributes are layered on top of the configured materializer 
settings attributes, so attributes set on a stream still take precedence.
   - Fix the Scaladoc of the Java `createMaterializer(systemProvider)` (it said 
"Scala API") and mention the new option in the stream basics docs.
   
   ### Result
   
   Users can create materializers whose default attributes apply to all streams 
they materialize.
   
   ### Tests
   
   - Not run locally - left to CI
   - New `MaterializerWithAttributesSpec` in stream-tests
   
   ### References
   Ported from (Apache-2.0 since 2026-10-23):
   - https://github.com/akka/akka-core/pull/32091
   
   ### Notes for reviewers
   - Binary compatibility: only additive overloads on the `Materializer` 
companion. The internal `StartMaterializer` case object was kept as is, and a 
new `StartMaterializerWithAttributes` case class was added, so no MiMa excludes 
are needed.
   - The new spec has an extra case checking that attributes on a stream 
override the materializer defaults.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to