英文:
Dapr pubsub consumer is not consuming messages
问题
I've got pubsub with Redis working locally. I can deploy to Azure and see messages being created in the topic subscription.
If I query /dapr/subscribe
I get [{ "topic": "TestGotUser", "pubsubName": "pubsub", "route": "PubSubEventGotUserSubscriber" }]
so it's wired as expected. My problem is the consumer is silently just not retrieving messages
app.MapPost("/PubSubEventGotUserSubscriber", async (DaprTestApis handler, MessageEvent item) =>
{
await handler.PubSubEventGotUserSubscriber(item);
}).WithTopic("pubsub", "TestGotUser");
// and handler
public async Task PubSubEventGotUserSubscriber(MessageEvent item)
{
_logger.LogInformation($"Received Message: User is {item.Message}");
await Task.CompletedTask;
}
the endpoint is never hit.
I'm using Managed Identities and the mi has "Azure Service Bus Data Receiver " and "Azure Service Bus Data Sender "
What could I be missing? I guess something in Azure. I am totally stuck.
英文:
I've got pubsub with Redis working locally. I can deploy to Azure and see messages being created in the topic subscription.
If I query /dapr/subscribe
I get [{"topic":"TestGotUser","pubsubName":"pubsub","route":"PubSubEventGotUserSubscriber"}]
so it's wired as expected. My problem is the consumer is silently just not retrieving messages
app.MapPost("/PubSubEventGotUserSubscriber", async (DaprTestApis handler, MessageEvent item) =>
{
await handler.PubSubEventGotUserSubscriber(item);
}).WithTopic("pubsub", "TestGotUser";
// and handler
public async Task PubSubEventGotUserSubscriber(MessageEvent item)
{
_logger.LogInformation($"Received Message: User is {item.Message}");
await Task.CompletedTask;
}
the endpoint is never hit.
I'm using Managed Identities and the mi has "Azure Service Bus Data Receiver " and "Azure Service Bus Data Sender "
What could I be missing? I guess something in Azure. I am totally stuck
答案1
得分: 0
The managed identity also creates topics and subscriptions, so needs more than 'Data Sender'.
我们的托管身份还创建主题和订阅,因此需要更多权限而不仅仅是“Data Sender”。
We went with 'Azure Service Bus Data Owner' (in dev) but this should really be more fine-grained in production ('Create or Update Topic' etc.).
我们选择了“Azure Service Bus Data Owner”(在开发中),但在生产环境中,这应该更加精细化(例如,“创建或更新主题”等)。
英文:
The managed identity also creates topics and subscriptions, so needs more than 'Data Sender'.
We went with 'Azure Service Bus Data Owner' (in dev) but this should really be more fine grained in production ('Create or Update Topic' etc.)
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论