PubSub.source
A source that will subscribe to a Topic
Topic
and stream messages published to the topic.
The source can be materialized multiple times, each materialized stream will stream messages published to the topic after the stream has started.
Note that it is not possible to propagate the backpressure from the running stream to the pub sub topic, if the stream is backpressuring published messages are buffered up to a limit and if the limit is hit the configurable OverflowStrategy
decides what happens. It is not possible to use the Backpressure
strategy.
Dependency
The Akka dependencies are available from Akka’s library repository. To access them there, you need to configure the URL for this repository.
- sbt
resolvers += "Akka library repository".at("https://repo.akka.io/maven")
- Maven
<project> ... <repositories> <repository> <id>akka-repository</id> <name>Akka library repository</name> <url>https://repo.akka.io/maven</url> </repository> </repositories> </project>
- Gradle
repositories { mavenCentral() maven { url "https://repo.akka.io/maven" } }
This operator is included in:
- sbt
val AkkaVersion = "2.9.1" libraryDependencies += "com.typesafe.akka" %% "akka-stream-typed" % AkkaVersion
- Maven
<properties> <scala.binary.version>2.13</scala.binary.version> </properties> <dependencyManagement> <dependencies> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-bom_${scala.binary.version}</artifactId> <version>2.9.1</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>com.typesafe.akka</groupId> <artifactId>akka-stream-typed_${scala.binary.version}</artifactId> </dependency> </dependencies>
- Gradle
def versions = [ ScalaBinary: "2.13" ] dependencies { implementation platform("com.typesafe.akka:akka-bom_${versions.ScalaBinary}:2.9.1") implementation "com.typesafe.akka:akka-stream-typed_${versions.ScalaBinary}" }
Signature
Reactive Streams semantics
emits a message published to the topic is emitted as soon as there is demand from downstream
completes when the topic actor terminates