tags:

views:

27

answers:

0

I have a front-end webservice. This service makes a "create" message to be processed in the 'back-end'. Previously it was not important to wait for this process to be finished but now this front-end service must wait until a functional key is generated to be returned to the front-end service callee.

The idea is to wait for a 'document created' like event so I know that I can now retrieve data based on a technical key so the functional key can be returned to the callee.

The problem is how can I make my front-end service wait for this notification message (until a certain time-out)? As somehow these two must be correlated but it is not really a request/response but also not a pure publish/subscribe model.

A description of the intended design

Front-end (web)service:

  1. Generate new guid (internal key)
  2. Send new creation message
  3. Wait for a notification is broadcasted to inform that a document is created and see if it matches the guid).
  4. Retrieve this document on its internal key and return the generated key.

Back-end

In the back-end a saga is:

  1. Delegates tasks to several services/components
  2. When this saga is completed it broadcasts this

Maybe the saga can be combined with a request/reply model but I have not found any example that does this.