I have similar problem as in Alpakka MongoDB - specify type in MongoSource
So I implemented my own MongoSource
as was in the solution and used it:
object MyMongoSource {
def apply[T](query: Observable[T]): Source[T, NotUsed] =
Source.fromPublisher(ObservableToPublisher(query))
}
val source: Source[Book, NotUsed] = MyMongoSource[Book](mongoDb.books.find())
But ObservableToPublisher
is private class
so I get the following error:
object ObservableToPublisher in package mongodb cannot be accessed in package akka.stream.alpakka.mongodb
How to resolve this?