Skip to content

[Proposal] Add PubSub examples over gPRC #825

@MregXN

Description

@MregXN

Background

Dapr supports HTTP API and gPRC API when the PubSub component works. But there is only PubSub example over HTTP in the java-sdk repo (What is more, the link of PubSub with subscriber over Http has been 404).

Problem

Some users want to publish/subscribe in their non-web applications. The current examples can't help as the HTTP examples will import web-related dependencies.

Proposal

  • For Subscriber

    • Add a GrpcService class that extends from AppCallbackGrpc.AppCallbackImplBase and implements the interfaces of listTopicSubscriptions and onTopicEvent so that it could interact with daprd via gRPC.
    • Modify DaprApplication to support switching protocals (HTTP or gPRC).
  • For Publisher
    Publisher use DaprClient which will run in different protocols according to system properties. So add codes about modifying system properties about protocols before DaprClient is initialed.

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