RequestMdc

uk.gov.hmrc.mdc.RequestMdc
object RequestMdc

Provides a stable store of MDC data relating to a Request.

As long as all data to be added to the MDC is added via RequestMdc (RequestMdc.add(request.id, Map("mykey", "myval"))), then RequestMdc.initMdc(request.id) can be called whenever a Request is in scope to ensure the thread has the correct MDC.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type
RequestMdc.type

Members list

Value members

Concrete methods

def add(requestId: Long, data: Map[String, String]): Unit

Adds the provided data to any existing MDC for the provided requestId

Adds the provided data to any existing MDC for the provided requestId

Attributes

def clear(requestId: Long): Unit

Clears the MDC for the provided requestId

Clears the MDC for the provided requestId

Attributes

def initMdc(requestId: Long): Unit

Ensures the MDC is populated with only the data previously registered with RequestMdc. It can be called periodically, to ensure MDC is correct. E.g. after an async boundary.

Ensures the MDC is populated with only the data previously registered with RequestMdc. It can be called periodically, to ensure MDC is correct. E.g. after an async boundary.

Attributes