Let's assume we have two Akka Stream flows, each running on its own JVM.
// A reactive streams publisher running on JVM 1:
val stringPublisher: Publisher[String] = Source(() => "Lorem Ipsum".split("\\s").iterator).runWith(Sink.publisher[String])
// A reactive streams subscriber running on JVM 2:
def subscriber: Subscriber[String] = Sink.foreach[String](println(_)).runWith(Source.subscriber[String])
// Subscribe the second stream to the first stream
stringPublisher.subscribe(subscriber)
This example runs fine on one JVM, but how can I subscribe to a publisher running on a different JVM?
Do I have to use messaging/queueing middleware or can I use the reactive streams API to connect the two together?