-
Notifications
You must be signed in to change notification settings - Fork 66
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
Unable to add multiple subscriptions #81
Comments
Actually, it looks like I can if I avoid using the async fn list_topic_subscriptions(
&self,
_request: Request<()>,
) -> Result<Response<ListTopicSubscriptionsResponse>, Status> {
// This commented out section only allows a single subscription with no ability to extend.
// let list_subscriptions =
// ListTopicSubscriptionsResponse::topic(self.pubsub_name.clone(), self.topic.clone());
let empty_metadata = None;
let list_subscriptions = ListTopicSubscriptionsResponse {
subscriptions: vec![
TopicSubscription::new("pubsub".to_owned(), "a".to_owned(), empty_metadata.clone()),
TopicSubscription::new("pubsub".to_owned(), "b".to_owned(), empty_metadata.clone()),
],
};
Ok(Response::new(list_subscriptions))
} This appears to work, based on the daprd logs:
|
It does appear to silently fail if you create two instances of the Dapr AppCallbackServers, like this which I had originally tried: Server::builder()
.trace_fn(|_| tracing::info_span!("tonic server"))
.add_service(AppCallbackServer::new(job_runner::JobRunner::new(
pubsub.as_str(),
topic.as_str(),
)))
.add_service(AppCallbackServer::new(job_runner::JobRunner::new(
pubsub.as_str(),
"another.topic",
)))
.serve(addr)
.await?; |
#87 (comment) |
There is currently no way to add additional subscriptions.
ListTopicSubscriptionResponse::topic(...)
is hard coded to a vector of one subscription: https://docs.rs/dapr/0.9.0/src/dapr/appcallback.rs.html#42Originally posted by @NickLarsenNZ in #80 (comment)
Other SDKs seem to be able to do it (I have seen it in action with .Net), for example dapr/python-sdk:
https://github.com/dapr/python-sdk/blob/1aab2cb1e06b32899183a285eab5c975408d05b2/ext/dapr-ext-grpc/dapr/ext/grpc/app.py#L137-L140
The text was updated successfully, but these errors were encountered: