public class ReactiveMongoContext extends Object
ReactiveMongoContext utilizes and enriches the Reactor Context with information potentially required
for e.g. ClientSession handling and transactions.Mono.subscriberContext(),
Context| Constructor and Description |
|---|
ReactiveMongoContext() |
| Modifier and Type | Method and Description |
|---|---|
static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.ClientSession> |
getSession()
Gets the
Mono<ClientSession> from Reactor Context. |
static reactor.util.context.Context |
setSession(reactor.util.context.Context context,
org.reactivestreams.Publisher<com.mongodb.reactivestreams.client.ClientSession> session)
Sets the
ClientSession into the Reactor Context. |
public static reactor.core.publisher.Mono<com.mongodb.reactivestreams.client.ClientSession> getSession()
Mono<ClientSession> from Reactor Context. The resulting Mono
emits the ClientSession if a session is associated with the current subscriber context. If the context does not contain a session, the resulting Mono terminates empty (i.e.
without emitting a value).Mono emitting the client session if present; otherwise the Mono terminates empty.public static reactor.util.context.Context setSession(reactor.util.context.Context context,
org.reactivestreams.Publisher<com.mongodb.reactivestreams.client.ClientSession> session)
ClientSession into the Reactor Context.context - must not be null.session - must not be null.Context.Context.put(Object, Object)Copyright © 2011–2020 Pivotal Software, Inc.. All rights reserved.