Вопрос

I'm attempting to create a messaging layer on top of the Service Bus .NET client library, giving me the ability to switch Service Bus out for something else if needed.

In my "receiver" class I can use the MessagingFactory's CreateMessageReceiver method to get a generic MessageReceiver that will work for both queues and subscriptions. My class can just be given the entity path and the MessagingFactory figures it out. However, from what I can tell, this generic receiver cannot deal with session-enabled queues and subscriptions - I must use a QueueClient or SubscriptionClient object to accept sessions.

Is there a way to receive from sessions without using a QueueClient or SubscriptionClient object?

Это было полезно?

Решение

The MessageSession is an equivalent of a MessageReceiver so from a processing perspective you can have a abstraction that takes in a MessageReceiver or a MessageSession. The way these are obtained is indeed different from the MessagingFactory.CreateMessageReceiver approach since you need to invoke that from a QueueClient or SubscriptionClient because the MessagingFactory.AcceptMessageSession does NOT take a URI path but actually returns sessions from the entire namespace (supported on with Service Bus on premise).

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top