HTTP Message Correlation
In order to support long running workflows or workflows that live for more than one Http message exchange we must support Correlation.
When a message is received, correlation allows the host to determine if the message is meant for a new or existing workflow instance. To make this determination it must have a method to obtain a correlation key.
Correlation Key Methods
- Custom - provide a class which returns an instance ID and set a host property to use it.
- Uri template arguments - use a value from the template as a instance key
- Cookies - stores the instance ID in a cookie
Content Based Correlation
Content based correlation is useful because it does not require the message sender to do anything different when sending a message to a workflow.
Content based correlation will be implemented by specifying the name of a Uri Template argument to be considered the correlation key. The requirement will be that the key be passed as a part of the Uri as is commonly done with HTTP services.
activity will add a cookie with the Workflow Instance ID
HTTP/1.1 200 OK
Date: Mon, 29 Aug 2011 22:57:47 GMT
When a client application wants to send a message to an existing instance, they need to set the cookie
GET http://127.0.0.1:8080/1 HTTP/1.1