开发者

Azure Queue Async Messages

开发者 https://www.devze.com 2023-03-25 03:18 出处:网络
We are thinking of speparate Queues for: Request (RequestQueue) Response (ResponseQueue) Scenario: Worker role will putMessage to RequestQueue e.g. Ge开发者_如何学CtOrders

We are thinking of speparate Queues for:

  1. Request (RequestQueue)
  2. Response (ResponseQueue)

Scenario:

  1. Worker role will putMessage to RequestQueue e.g. Ge开发者_如何学CtOrders
  2. Third party will monitor RequestQueue. If they see GetOrders request they will getMessage, process them and put the response in ResponseQueue.

Question: If I putMessage to RequestQueue, I will like to get results back from ResponseQueue. Is there easy way to achieve this and how?

Thank you.


No, this is not possible. If you put a message in a queue, you must pop the message from the same queue (it will not magically appear in any other queue). Perhaps if you explained more why you think you need two separate queues here for push/pop, there might be a more expansive answer and suggestion.

EDIT: Perhaps I misunderstood your intent. I guess I don't get the question now - can you help clarify. You seem to be asking how to put a message on one queue, acknowledge it by putting another message on another queue, and have someone read the acknowledgment from the second queue? What is the question here? I should point out that you won't want some 3rd party to read directly from a Windows Azure queue as that would require sharing the master storage key with them (a non-starter). Perhaps you are looking for how to have 3rd parties read from a queue?

EDIT 2: Sounds like you want to consume messages with a 3rd Party. Windows Azure queues probably are not a good fit as I mentioned due to security reasons (you need to share the master key). Instead, you could either layer a WCF service over the queue (using queues via proxy) or use the queueing from the Service Bus - that will allow you to have separate credentials. Using the Service Bus capability might be the right choice here in terms of simplicity. Take a look here for demos.


Have a worker of some sort monitor the question queue, then post an answer to the answer queue. Interface out the queue managers and you shouldn't have any problems using any sort of queue tech. Also, the worker doesn't really need to use a queue for answers..

Caveats:

  1. Worker service has access to both queues
  2. Each queue item contains a serialized foreign key to identify themselves.
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号