akka / alpakka

Alpakka is a Reactive Enterprise Integration library for Java and Scala, based on Reactive Streams and Akka.
https://doc.akka.io/docs/alpakka/current/
Other
1.26k stars 647 forks source link

Google pubSub Grpc. Impl PublishWithContext and make subscriber and publisher accessible #2881

Open bc-tayvs opened 2 years ago

bc-tayvs commented 2 years ago

Short description

Publish with context

https://github.com/akka/alpakka/blob/d27748d1c1f29ae3b9e93f20d769109bd90bc60a/google-cloud-pub-sub-grpc/src/main/scala/akka/stream/alpakka/googlecloud/pubsub/grpc/scaladsl/GooglePubSub.scala#L28

publish method is not enough when you need to propagate context. FlowWithContext variant also needed.

Subscriber and publisher accessibillity

When you need custom publish flow, subscriber and publisher will be very useful

https://github.com/akka/alpakka/blob/d27748d1c1f29ae3b9e93f20d769109bd90bc60a/google-cloud-pub-sub-grpc/src/main/scala/akka/stream/alpakka/googlecloud/pubsub/grpc/scaladsl/GooglePubSub.scala#L130

https://github.com/akka/alpakka/blob/d27748d1c1f29ae3b9e93f20d769109bd90bc60a/google-cloud-pub-sub-grpc/src/main/scala/akka/stream/alpakka/googlecloud/pubsub/grpc/scaladsl/GooglePubSub.scala#L136

Details

I made PR with small changes

  1. Introduce publishWithContext method
  2. Made subscriber and publisher package private. In case when you need custom approach or just client

Explain your idea in more detail and possibly suggest different ways to achieve it.

bc-tayvs commented 2 years ago

@raboof @ennru @patriknw plz take a look