Azure EventGrid主题中的多个EventType [英] Multiple EventTypes in Azure EventGrid Topic

查看:82
本文介绍了Azure EventGrid主题中的多个EventType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于Azure EventGrid主题和事件的最佳实践是什么?

What is the best practices around Azure EventGrid topics and Events?

将不同的事件类型发布到同一Azure EventGrid主题不是一个好主意吗?例如多个不同的域事件

Is it a bad idea to publish different event-types to the same Azure EventGrid topic? e.g. multiple different domain events

我们什么时候需要不同的主题?整个应用程序的单个共享主题?每个汇总根类型一个主题?每个事件类型一个主题?

When do we need different topics? A single shared Topic for an entire application? One Topic per Aggregate Root type? One Topic per Event Type?

由于没有明确的答案,任何建议都将受到欢迎

Any suggestions would be welcome as there are no clear answers

第2部分.

如果我想与各种Azure Logic应用程序集成怎么办?如果多个逻辑应用程序对同一主题做出反应,它们是否会窃取彼此的消息?每个逻辑应用程序都会创建一些不可见的订阅吗?

What if I want to integrate with various Azure Logic Apps? if multiple logic apps react to the same topic, would they steal messages from each-other? Do each logic app create some invisible subscription?

推荐答案

不,将不同的事件类型发布到同一Azure EventGrid主题不是一个坏主意:如果事件与同一资源相关,则不会将它们发布到相同的EventGrid主题是很有意义的.以HR应用程序为例,您可以在同一员工"主题上发布EmployeeAdded和EmployeeRemoved事件.

No, it is not a bad idea to publish different event-types to the same Azure EventGrid topic: if the events are related to the same resource, it does make sense to publish them to the same EventGrid topic. Taking the example of a HR application, you can have EmployeeAdded and EmployeeRemoved events published on the same "employee" topic.

关于何时需要不同主题的问题,我认为这取决于一些因素,例如您如何对应用程序中的资源建模,对这些资源感兴趣的事件,围绕系统哪些部分的安全模型应该能够发布到该主题/关于该主题的事件订阅的创建.理想情况下,同一资源类型(例如,上例中的员工"资源类型)的所有事件类型都可以在同一主题上.当系统具有更多类型的资源时,您可能希望为它们中的每一个创建单独的主题.另外,还必须考虑所需的安全模型(例如,假设您要限制谁可以接收某些类型的事件的访问权限).

On the question on when different topics would be needed, I think it depends on a few factors such as how you are modelling the resources in your application, the events of interest on those resources, security model around which parts of the system should be able to publish to the topic / creation of event subscriptions on the topic. Ideally, all types of events for the same resource type (such as the "employee" resource type in the example above) can be on the same topic. When your system has more types of resources, you may want to create separate topics for each of them. Also, the desired security model has to be taken into account as well (e.g. let's say you want to restrict access to who can receive certain types of events).

关于逻辑应用程序的问题,如果您创建多个逻辑应用程序来处理来自同一主题的事件,则每个逻辑应用程序都会在同一主题上创建事件订阅,并且事件网格"会将有关该主题的事件传递给每个事件订阅.因此,每个逻辑应用程序将单独接收相同的事件,并且可以独立于其他应用程序进行处理.

Regarding the question about logic apps, if you create multiple logic apps that handle events from the same topic, each of them creates an event subscription on the same topic, and Event Grid would deliver the events on that topic to each of the event subscriptions. So, each logic app would receive the same event individually, and can process it independent of the other apps.

这篇关于Azure EventGrid主题中的多个EventType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆