-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Today using Flux with streaming subscriptions in Java, you can only publish/subscribe using Dapr's CloudEvent type as shown in the example here:
| client.subscribeToEvents( |
The latest PR by @artur-ciocanu is an improvement since subscribeToEvents() uses a flux based method but the limitation here is that only the CloudEvent can be sent.
We should also support something like the following as many users will be sending generic types (not cloud event based) on the message broker and this is supported in Dapr Pubsub generally.
public <T> Flux<T> subscribeToEvents(...
One way to standardize this would be to add an override that uses the DaprAppCallbackProtos.TopicEventRequest topicEventRequest type which can be deserialized as per the example here: https://github.com/artur-ciocanu/java-sdk/blob/26d215342bf541135c200ba22fd085b8a4e1c010/examples/src/main/java/io/dapr/examples/pubsub/grpc/SubscriberGrpcService.java#L67