Can I add a correlation token to the header of a message?

Yes. As of 4.0, AMPS adds a CorrelationId header which is set by the publisher and transmitted to subscribers.

AMPS does not interpret or modify the CorrelationId. This field is reserved for use by the publisher.

There are a few things to keep in mind:

  • The CorrelationId contain only characters used in base64 encoding (it does not have to actually be base64 encoded, but must only use those characters).

  • SOW queries return the CorrelationId for the current state of the message.

  • Delta publish messages update the CorrelationId if the delta publish contains the CorrelationId.

  • OOF messages contain the CorrelationId that corresponds to the message body delivered with the OOF.

  • Conflated topics provide the CorrelationId that is current when the conflated topic is updated.

  • Views do not provide a CorrelationId: since views provide the ability to create a projection based on any number of underlying messages, AMPS treats a message from a view as a new message and does not propagate the CorrelationId.

Last updated