Feature:
extract MDC from Context in "contextWrite" and thus simplifies context writing
val data = MDCContext.read() // Mono<MDC> by default context key
.mapNotNull { it["key"] }
.contextWrite {
val mdc = MDCContext.getMDCOrDefault(it) // return: MDC, if not exist define, it will create a default
mdc["key"] = "example"
MDCContext.put(it, mdc) // result: Context
}
StepVerifier.create(data2)
.expectNext("example")
.verifyComplete()
Deprecated
withEnableError
builder method because the name is not accurate. EnableError and paramter is false.. It is misleading. Change to:
- if not called, the error configuration is disabled
withError()
set to true by default
- you can configure it directly by the
withError(boolean)
.