【发布时间】:2017-09-09 09:04:09
【问题描述】:
我正在使用 Azure 存储队列,我想编写一些代码来检索所有队列,然后找到可以处理此队列中的消息的处理程序。为此,我定义了一个这样的接口:
public interface IHandler<T>
我有这个接口的多个实现,例如:IHandler<CreateAccount> 或 IHandler<CreateOrder>。我对每种消息类型使用 1 个队列,因此 CreateAccount 消息将进入 create-account-queue。
如何连接这些?为了找到适合消息的 Handler 类,我首先需要知道消息类型,但似乎 CloudQueueMessage 对象不包含该信息。
【问题讨论】:
标签: azure queue azure-storage message-queue azure-storage-queues