Question

I have a WCF service with public REST and SOAP endpoints that has a single post method. Currently the app processes as follows

  1. Object Posted to service method
  2. Service method passes data to storage queue then sends an XML response.
  3. Second worker role checks queue, does some processing and depending on processing, adds record to DB or rejects it.

My problem currently is that the WCF method responds before a decision is made to accept or reject the message. There is a lot of processing, and various worker roles are used after the WCF message is received depending on customer settings. I would like to be able to make the accept/reject decision and then respond with relevant data. I am wondering how to do this.

I could do an asynchronous Service method, but then all code would need to go into the WCF role or callable library which isn't ideal. Is there a way to not to the async End method until there is a response from another worker role (a message is in the queue)? I realize I could just do a thread.sleep and check the queue periodically, but then I would have to add the original request data to the queue and I really don't think that's the correct way to do things. I Googled this and couldn't find a concrete, non-hackish method.

Let me know if code samples would help, but (I think) it's pretty straightforward.

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top