-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal: PubSub Subscription Streaming #52
Proposal: PubSub Subscription Streaming #52
Conversation
Signed-off-by: joshvanl <[email protected]>
|
||
When a message is published to the topic, Daprd will send a `TopicEventRequest` message on the stream containing the message payload and metadata. | ||
After the application has processed the message, it will send to the server a `SubscribeTopicEventsResponse` containing the `id` of the message and the `status` of the message processing. | ||
Since multiple messages can be sent and processed in the application at the same time, the event `id` is used by the server to track the status of each individual event. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How's the event ID computed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe either from the pubsub itself, or a random UUID here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Isn't that for cloud events only?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can generate a unique id per message the same way bulk pub/sub does today
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
Signed-off-by: joshvanl <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please change all endpoints (HTTP, gRPC) to be alpha
|
||
``` | ||
GET: /v1.0/subscribe | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we have a request response sample for this endpoint?
service Dapr { | ||
// SubscribeTopicEvents subscribes to a PubSub topic and receives topic events | ||
// from it. | ||
rpc SubscribeTopicEvents(stream SubscribeTopicEventsRequest) returns (stream TopicEventRequest) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
later on, would we want to use the same RPC for bulk subscribe as well?
If so should the TopicEventRequest stream be wrapped by another message so that we can extend to Bulk Subscribe event as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, we can wrap the TopicEventRequest
for doing bulk messages, though don't necessarily see the use case for this.
service Dapr { | ||
// SubscribeTopicEvents subscribes to a PubSub topic and receives topic events | ||
// from it. | ||
rpc SubscribeTopicEvents(stream SubscribeTopicEventsRequest) returns (stream TopicEventRequest) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rpc SubscribeTopicEvents(stream SubscribeTopicEventsRequest) returns (stream TopicEventRequest) {} | |
rpc SubscribeTopicEvents(stream SubscribeTopicEventsRequestAck) returns (stream TopicEventRequest) {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ack
is not appropriate at the first message on this stream will be the initial request, not an acknowledgment.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was more looking for a name which covers both messages.
@JoshVanL could you also mention what changes are needed in SDK to support this? |
@mukundansundar I'm not too sure what else needs to be added regarding SDK implementations- they need to implement the streaming client as described in the proposal . |
Signed-off-by: joshvanl <[email protected]>
stream.CloseSend() | ||
``` | ||
|
||
### HTTP (WebSockets) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WebSockets make things a lot more complicated, including things like authz. We support HTTP/2 now so we should just use server-sent events (since we don't need bi-di streaming). It's much simpler to implement and use, and doesn't introduce a lot more dependencies on the server.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't use unidirectional streaming because the client needs to send back information to the server (Dapr), which is the status for each message received. From the auth perspective this wouldn't be different from how an app authenticates to Dapr today (via an access token, and unauthenticated by default) and even in browser to server scenarios a client access token is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The send-back can be done with regular HTTP requests. When using HTTP/2, they use the same TCP socket, so this wouldn't be an issue.
I would recommend avoiding adding another protocol as it does make a lot of things more complicated.
- Go doesn't support WebSockets over HTTP/2, but only HTTP/1, so the app requires a separate socket: proposal: x/net/http2: support for WebSockets over HTTP/2 golang/go#49918
- When connecting to a WS using a web browser, you can't customize the headers, so Dapr authentication wouldn't be usable (https://devcenter.heroku.com/articles/websocket-security#authentication-authorization). I understand that connecting directly to Dapr through a web browser is not officially supported, but some customers do that. Hence why I mentioned auth is more challenging.
- WebSockets also adds complexities when dealing with proxies (this may be a problem for some Diagrid services too presumably :) ), and local development requires tooling that is WebSockets-aware.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auth remains token based auth, but it doesn't have to pass through a header in this case. The initial handshake contains the token as described in the link you posted. This seems like a standard way for client side auth and is also used by the Azure Websockets (PubSub) service, as one example.
Re: web browser, it'd actually be great to make this HTTP path usable from web browsers, where http/2 doesn't have the same support as websockets. This will provide a clearer usage pattern where backend services can connect over gRPC while web services and/or any client that doesn't have gRPC or http/2 support can use websockets.
The only issue we face with websockets is the separate socket issue. If the same port cannot be shared with the existing HTTP server and the Websockets server than this is likely a non-starter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The auth remains token based auth, but it doesn't have to pass through a header in this case. The initial handshake contains the token as described in the link you posted.
Correct, but that's part of the application protocol we need to define, and it does add complexity.
it'd actually be great to make this HTTP path usable from web browsers, where http/2 doesn't have the same support as websockets
Support for HTTP/2 in browser is just as much as WebSockets. In any case, HTTP/2 is a nice-to-have for long-lived connections but not a requirement (using HTTP/1 would be fine, but would require one separate TCP socket).
The only issue we face with websockets is the separate socket issue. If the same port cannot be shared with the existing HTTP server and the Websockets server than this is likely a non-starter.
Separate socket, not port. So the long-lived connection requires its own TCP socket between the app and Dapr (1 TCP socket for the WebSockets long-lived stream, and then each request from the app will have its own). While in the case of HTTP/2 there's multiplexing being used, so there is at most 1 TCP socket being used (the long-lived stream can share the same socket as every request going to Dapr). This does improve efficiency. But it doesn't require a separate port - the same Go server can serve HTTP/1, HTTP/2, and WebSockets (but this only over HTTP/1 and not HTTP/2, per issue above)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, so if we don't need a separate port and there's a path forward for HTTP/2 support for WebSockets then I'm comfortable using WebSockets HTTP 1.1 to start with
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The issue for adding WebSockets over HTTP/2 was opened in 2021 and looks like it's not being worked on. It seems that it is not a priority (understandably, as WebSockets is not as popular as it once was).
I think enabling a new communication protocol should be something not done lightly, as we'll be on the hook to support that for a very long time. There's nothing inherently wrong with HTTP/2, which is already supported and we have all tooling and test in place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user experience that comes out of having a full-duplex bidi stream with the receive message/reply to server commands encapsulated within WebSockets is preferable to me than what the experience would be like with SSE, moreover the latter being limited to a text format. We can always change to HTTP2/SSE if we're seeing a reason to do so before moving the API to stable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Although WebSocket is not that popular, it is still very useful in full-duplex bidi stream case. I think it is a good start and we can Iterate it based on users' response and so on.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am open to looking at the maintainability aspect of Websockets and we could also potentially ping for the interest in the duplex stream from the community.
But this proposal looks good for gRPC as a starter.
A suggestion... rather than encouraging end-users to make many calls to From an end-users perspective, it would be safer for the I've tried to express what I'm suggesting with a sequence diagram. I've kept the diagram to non-streaming to Keep It Simple, but I don't see why this pattern couldn't map to a streaming use-case as originally intended by this Proposal. Pros
Cons
|
The scope of this proposal is to solve the highly requested feature to allow apps to subscribe dynamically without needing to listen on a port, thereby simplifying the user experience, elevating security and working around network limitations. Most of not all messaging SDKs including the ones used by Dapr encourage users to add subscriptions programmatically |
@yaron2 would the sequence of what I've suggested not fit into the original framework of the proposal for streaming too? |
Not as long as it entails Dapr needing to reach the app. I think what you introduced should be coupled with introducing a pull based messaging mode to Dapr, which is highly useful in and as of itself, albeit needing a separate proposal |
I fully understand the proposals need to not open inbound ports on the App - I just used the non-streaming example to present the sequence of events between Dapr & App. This is why I wrote :
My assumption was that the same sequence of events could be transferred to grpc/WS? Was my assumption wrong? :) |
- [ ] SDK implementations | ||
- [ ] .Net | ||
- [ ] Java | ||
- [ ] Go | ||
- [ ] Python | ||
- [ ] JavaScript |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- [ ] SDK implementations | |
- [ ] .Net | |
- [ ] Java | |
- [ ] Go | |
- [ ] Python | |
- [ ] JavaScript | |
- [ ] SDK implementations | |
- [ ] .Net | |
- [ ] Java | |
- [ ] Go | |
- [ ] Python | |
- [ ] JavaScript | |
- [ ] Rust |
Please can I propose that this proposal tracks the Rust-SDK too :)
string id = 1 [json_name = "id"]; | ||
|
||
// status is the result of the subscription request. | ||
TopicEventResponseAlpha1 status = 2 [json_name = "status"]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TopicEventResponse
refers to a response on a published message am I right in reading this as it being used as a response for the subscription response too? If so seems a bit too tightly coupled in my opinion
+1 binding |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1 binding
I'm opposed until websockets are removed |
Recusing myself from voting. |
Is there any specific reason why web sockets should not be supported? |
+1 binding with the understanding that we might reconsider web sockets based implementation if needed. |
I am recusing my vote. |
We have enough binding votes for this proposal. |
Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]>
healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]>
healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]>
* Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Updates go.mod go version to 1.22.3 in e2e apps Signed-off-by: joshvanl <[email protected]> * Remove small context timeout on httpserver int tests Signed-off-by: joshvanl <[email protected]> * Wait for daprd2 to be ready before calling meta endpoint in hot-op-inf-comp test Signed-off-by: joshvanl <[email protected]> * Increase int test daprd wait until ready timeout to 30s Signed-off-by: joshvanl <[email protected]> * Assert httpendpoint int test resp body with eventually Signed-off-by: joshvanl <[email protected]> * Set subscription APIs Alpha1 Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Co-authored-by: Yaron Schneider <[email protected]>
Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]>
healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]>
* Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Updates go.mod go version to 1.22.3 in e2e apps Signed-off-by: joshvanl <[email protected]> * Remove small context timeout on httpserver int tests Signed-off-by: joshvanl <[email protected]> * Wait for daprd2 to be ready before calling meta endpoint in hot-op-inf-comp test Signed-off-by: joshvanl <[email protected]> * Increase int test daprd wait until ready timeout to 30s Signed-off-by: joshvanl <[email protected]> * Assert httpendpoint int test resp body with eventually Signed-off-by: joshvanl <[email protected]> * Set subscription APIs Alpha1 Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Signed-off-by: Elena Kolevska <[email protected]>
… healthz. (#7757) * Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-directional subscription streaming- subscribe on no healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]> * Fix unit tests Signed-off-by: joshvanl <[email protected]> * Fix subscription allowed Signed-off-by: joshvanl <[email protected]> * Adds review comments Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Yaron Schneider <[email protected]>
Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]>
healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]>
* Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-directional subscription streaming- subscribe on no healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]> * Fix unit tests Signed-off-by: joshvanl <[email protected]> * Fix subscription allowed Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-di index on per subscription Index on per subscription so that streams or Subscription hot reloading events will only reload that specific subscription, rather than reloading _every_ subscription for that PubSub component. This dramatically reduces disruption to topic subscriptions for a given PubSub component. Signed-off-by: joshvanl <[email protected]> * Lock streamer when sending topic mesgae to stream connection Signed-off-by: joshvanl <[email protected]> * Log Info when a streaming subscription unsubscribes Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]>
* Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Updates go.mod go version to 1.22.3 in e2e apps Signed-off-by: joshvanl <[email protected]> * Remove small context timeout on httpserver int tests Signed-off-by: joshvanl <[email protected]> * Wait for daprd2 to be ready before calling meta endpoint in hot-op-inf-comp test Signed-off-by: joshvanl <[email protected]> * Increase int test daprd wait until ready timeout to 30s Signed-off-by: joshvanl <[email protected]> * Assert httpendpoint int test resp body with eventually Signed-off-by: joshvanl <[email protected]> * Set subscription APIs Alpha1 Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Signed-off-by: Annu Singh <[email protected]>
… healthz. (dapr#7757) * Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-directional subscription streaming- subscribe on no healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]> * Fix unit tests Signed-off-by: joshvanl <[email protected]> * Fix subscription allowed Signed-off-by: joshvanl <[email protected]> * Adds review comments Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Signed-off-by: Annu Singh <[email protected]>
* Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-directional subscription streaming- subscribe on no healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]> * Fix unit tests Signed-off-by: joshvanl <[email protected]> * Fix subscription allowed Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-di index on per subscription Index on per subscription so that streams or Subscription hot reloading events will only reload that specific subscription, rather than reloading _every_ subscription for that PubSub component. This dramatically reduces disruption to topic subscriptions for a given PubSub component. Signed-off-by: joshvanl <[email protected]> * Lock streamer when sending topic mesgae to stream connection Signed-off-by: joshvanl <[email protected]> * Log Info when a streaming subscription unsubscribes Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Annu Singh <[email protected]>
… healthz. (dapr#7757) * Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-directional subscription streaming- subscribe on no healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]> * Fix unit tests Signed-off-by: joshvanl <[email protected]> * Fix subscription allowed Signed-off-by: joshvanl <[email protected]> * Adds review comments Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Co-authored-by: Dapr Bot <[email protected]> Co-authored-by: Yaron Schneider <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
* Subscriptions: bi-directional subscription & publish streaming. Adds SubscribeTopicEvents proto API which dynamically subscribes to pubsub topics based on dapr/proposals#52. This is a basic gRPC implementation of the API whereby, like Subscription hot-reloading today, subscribing to a topic will reload _every_ active subscription for the current daprd. In a future PR, reloading of Subscriptions will be granular to the specific pubsub topic. Stream subscriptions are also only active once daprd declares the application as both present and ready. Dynamic stream subscriptions should be active both whether a app is running or not, as well as whether it is ready or not. This will be addressed in a future PR. Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-directional subscription streaming- subscribe on no healthz. Refactors pubsub machinery to allow for gRPC bi-directional subcription streaming when there is no application, or the application in unhealhty. dapr/proposals#52 Signed-off-by: joshvanl <[email protected]> * Fix unit tests Signed-off-by: joshvanl <[email protected]> * Fix subscription allowed Signed-off-by: joshvanl <[email protected]> * Subscriptions: bi-di index on per subscription Index on per subscription so that streams or Subscription hot reloading events will only reload that specific subscription, rather than reloading _every_ subscription for that PubSub component. This dramatically reduces disruption to topic subscriptions for a given PubSub component. Signed-off-by: joshvanl <[email protected]> * Lock streamer when sending topic mesgae to stream connection Signed-off-by: joshvanl <[email protected]> * Log Info when a streaming subscription unsubscribes Signed-off-by: joshvanl <[email protected]> --------- Signed-off-by: joshvanl <[email protected]> Signed-off-by: Jake Engelberg <[email protected]>
No description provided.