Hi! A Consumer (in the future, Subscriber) can only be connected to one producer, and as such you need to merge multiple producers (in the future, Publisher) into one. Choose between merge/concat/zip depending on desired semantics.
On Thu, Aug 7, 2014 at 1:11 PM, Christian Douven <[email protected]> wrote: > Hello, > > is it possible to connect multiple producers to a single consumer? > > > I have the following use case: > > Multiple producers create events which I want to be in a single event > stream. > > > > Currently I create my Consumer like this: > > > val (eventConsumer, eventProducer) = Duct[MyEvent].build(FlowMaterializer( > MaterializerSettings())) > > > Then I attach a consumer to the event producer to have all events > consumed, since I don't need any Events that get produced when there is no > one listening: > > eventProducer.produceTo(new DevNullConsumer()) > > > Now that what "fails": > > eventProducer.produceTo(testConsumer) > > Flow(List[MyEvent](event1)).toProducer(FlowMaterializer( > MaterializerSettings())).produceTo(eventConsumer) > Flow(List[MyEvent](event2)).toProducer(FlowMaterializer( > MaterializerSettings())).produceTo(eventConsumer) > > > > > > TestConsumer will receive only the "event1". > > > Are Consumer[T] not ment to be fed by multiple producers? > > I somehow have the feeling, that the first Flow completes the whole > thing..... > > > > Best regards > > Christian > > > > > -- > >>>>>>>>>> Read the docs: http://akka.io/docs/ > >>>>>>>>>> Check the FAQ: > http://doc.akka.io/docs/akka/current/additional/faq.html > >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user > --- > You received this message because you are subscribed to the Google Groups > "Akka User List" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > Visit this group at http://groups.google.com/group/akka-user. > For more options, visit https://groups.google.com/d/optout. > -- Cheers, √ -- >>>>>>>>>> Read the docs: http://akka.io/docs/ >>>>>>>>>> Check the FAQ: >>>>>>>>>> http://doc.akka.io/docs/akka/current/additional/faq.html >>>>>>>>>> Search the archives: https://groups.google.com/group/akka-user --- You received this message because you are subscribed to the Google Groups "Akka User List" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/akka-user. For more options, visit https://groups.google.com/d/optout.
