Skip to content

Flux Streaming subscriptions with generic type #1616

@alicejgibbons

Description

@alicejgibbons

Today using Flux with streaming subscriptions in Java, you can only publish/subscribe using Dapr's CloudEvent type as shown in the example here:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions