topic) val source: Source[PublishRequest, NotUsed] = { val msgs = (1 to 10).map { i => PubSubMessage( messageId = i.toString, data = new String(Base64.getEncoder.encode("Hello".getBytes)) )} Source.single(PublishRequest(msgs)) } val publishedMessageIds: Future[Done] = source.via(publishFlow).runWith(Sink.ignore)