-
Notifications
You must be signed in to change notification settings - Fork 345
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
Issue with Consumer ID in Dapr Topic Subscription #1360
Comments
@mshashi0306 |
@mshashi0306 Have you had an opportunity to try out my suggestion? |
Yes @WhitWaldo , I have tried adding the consumerId to the YAML file, but it requires creating multiple service bus component files for each subscription. I’m looking to have a single YAML file without the consumerId, as I have multiple subscriptions under one topic. Could you please help with this? |
I've raised your question on Discord in hopes someone there knows as I'm afraid I don't immediately see how you'd pass the consumer ID in any but a declarative instance. |
@mshashi0306 : What's the problem you are encountering? You don't receive messages in your subscription handler? Have you tried using a minimal API like below? var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();
app.UseRouting();
app.UseCloudEvents();
app.MapSubscribeHandler();
app.MapPost("ReceiveFeedEvent", "/ReceiveFeedEvent")
.WithTopic(new TopicOptions {
PubsubName = Config.DaprAlertFeedConsumerName,
Name = configuration[Config.AlertFeedTopicNameKey],
Metadata = new Dictionary<string, string>() { { "consumerID","feed"} }
});
app.Run(); Also note the |
I'm working with a Dapr application, and I'm having trouble with my topic subscription setup in the following code:
builder.MapControllerRoute("ReceiveFeedEvent", "/ReceiveFeedEvent").WithTopic(new TopicOptions { PubsubName = Config.DaprAlertFeedConsumerName, Name = configuration[Config.AlertFeedTopicNameKey], Metadata = new Dictionary<string, string>() { { "consumerID","feed"} } });
I'm using this configuration to set up a route that receives events from a specified topic. However, it seems that the consumerID I specified in the metadata does not work as expected.
Kindly help if there is a specific format or requirement for the consumerID in Dapr subscriptions?
I am trying to subscribe multiple subscription under one topic using Dapr.
The text was updated successfully, but these errors were encountered: