Top Description Fields Constructors Methods
org.springframework.messaging.rsocket.annotation.support

pack-priv Class MessagingRSocket

extends Object
implements RSocket
Class Inheritance
All Implemented Interfaces
io.rsocket.RSocket, io.rsocket.Closeable, reactor.core.Disposable, io.rsocket.Availability
Imports
java.util.Map, java.util.concurrent.atomic.AtomicBoolean, .AtomicReference, io.rsocket.ConnectionSetupPayload, .Payload, .RSocket, io.rsocket.frame.FrameType, org.reactivestreams.Publisher, reactor.core.publisher.Flux, .Mono, org.springframework.core.io.buffer.DataBuffer, .DataBufferUtils, .NettyDataBuffer, org.springframework.lang.Nullable, org.springframework.messaging.Message, .MessageHeaders, .ReactiveMessageHandler, org.springframework.messaging.handler.DestinationPatternsMessageCondition, org.springframework.messaging.handler.invocation.reactive.HandlerMethodReturnValueHandler, org.springframework.messaging.rsocket.MetadataExtractor, .PayloadUtils, .RSocketRequester, .RSocketStrategies, org.springframework.messaging.support.MessageBuilder, .MessageHeaderAccessor, org.springframework.util.Assert, .MimeType, .RouteMatcher

Responder RSocket that wraps the payload and metadata of incoming requests as a Message and then delegates to the configured RSocketMessageHandler to handle it. The response, if applicable, is obtained from the "rsocketResponse" header.
Author
Rossen Stoyanchev
Since
5.2

Field Summary

Modifier and TypeField and Description
private final MimeType
private final ReactiveMessageHandler
private final MetadataExtractor
private final MimeType
private final RSocketRequester
private final RouteMatcher
private final RSocketStrategies

Constructor Summary

AccessConstructor and Description
pack-priv
MessagingRSocket(MimeType dataMimeType, MimeType metadataMimeType, MetadataExtractor metadataExtractor, RSocketRequester requester, ReactiveMessageHandler messageHandler, RouteMatcher routeMatcher, RSocketStrategies strategies)

Method Summary

Modifier and TypeMethod and Description
private MessageHeaders
createHeaders(Payload payload, FrameType frameType, AtomicReference<Flux<Payload>> responseRef)

public Mono<Void>
fireAndForget(Payload
Request payload.
payload
)

Overrides default io.rsocket.RSocket.fireAndForget.

Fire and Forget interaction model of RSocket.
private Mono<Void>
handle(Payload payload, FrameType frameType)

private Flux<Payload>
handleAndReply(Payload firstPayload, FrameType frameType, Flux<Payload> payloads)

public Mono<Void>

Returns:

completion handle for success or error
handleConnectionSetupPayload
(ConnectionSetupPayload
the connection payload
payload
)

Wrap the ConnectionSetupPayload with a Message and delegate to handle(Payload, FrameType) for handling.

public Mono<Void>
metadataPush(Payload
Request payloads.
payload
)

Overrides default io.rsocket.RSocket.metadataPush.

Metadata-Push interaction model of RSocket.
private int
refCount(DataBuffer dataBuffer)

public Flux<Payload>
requestChannel(Publisher<Payload>
Stream of request payloads.
payloads
)

Overrides default io.rsocket.RSocket.requestChannel.

Request-Channel interaction model of RSocket.
public Mono<Payload>
requestResponse(Payload
Request payload.
payload
)

Overrides default io.rsocket.RSocket.requestResponse.

Request-Response interaction model of RSocket.
public Flux<Payload>
requestStream(Payload
Request payload.
payload
)

Overrides default io.rsocket.RSocket.requestStream.

Request-Stream interaction model of RSocket.
private DataBuffer
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

dataMimeTypeback to summary
private final MimeType dataMimeType
messageHandlerback to summary
private final ReactiveMessageHandler messageHandler
metadataExtractorback to summary
private final MetadataExtractor metadataExtractor
metadataMimeTypeback to summary
private final MimeType metadataMimeType
requesterback to summary
private final RSocketRequester requester
routeMatcherback to summary
private final RouteMatcher routeMatcher
strategiesback to summary
private final RSocketStrategies strategies

Constructor Detail

MessagingRSocketback to summary
pack-priv MessagingRSocket(MimeType dataMimeType, MimeType metadataMimeType, MetadataExtractor metadataExtractor, RSocketRequester requester, ReactiveMessageHandler messageHandler, RouteMatcher routeMatcher, RSocketStrategies strategies)

Method Detail

createHeadersback to summary
private MessageHeaders createHeaders(Payload payload, FrameType frameType, AtomicReference<Flux<Payload>> responseRef)
fireAndForgetback to summary
public Mono<Void> fireAndForget(Payload payload)

Overrides default io.rsocket.RSocket.fireAndForget.

Doc from io.rsocket.RSocket.fireAndForget.

Fire and Forget interaction model of RSocket.

Parameters
payload:Payload

Request payload.

Returns:Mono<Void>

Publisher that completes when the passed payload is successfully handled, otherwise errors.

Annotations
@Override
handleback to summary
private Mono<Void> handle(Payload payload, FrameType frameType)
handleAndReplyback to summary
private Flux<Payload> handleAndReply(Payload firstPayload, FrameType frameType, Flux<Payload> payloads)
Annotations
@SuppressWarnings:deprecation
handleConnectionSetupPayloadback to summary
public Mono<Void> handleConnectionSetupPayload(ConnectionSetupPayload payload)

Wrap the ConnectionSetupPayload with a Message and delegate to handle(Payload, FrameType) for handling.

Parameters
payload:ConnectionSetupPayload

the connection payload

Returns:Mono<Void>

completion handle for success or error

metadataPushback to summary
public Mono<Void> metadataPush(Payload payload)

Overrides default io.rsocket.RSocket.metadataPush.

Doc from io.rsocket.RSocket.metadataPush.

Metadata-Push interaction model of RSocket.

Parameters
payload:Payload

Request payloads.

Returns:Mono<Void>

Publisher that completes when the passed payload is successfully handled, otherwise errors.

Annotations
@Override
refCountback to summary
private int refCount(DataBuffer dataBuffer)
requestChannelback to summary
public Flux<Payload> requestChannel(Publisher<Payload> payloads)

Overrides default io.rsocket.RSocket.requestChannel.

Doc from io.rsocket.RSocket.requestChannel.

Request-Channel interaction model of RSocket.

Parameters
payloads:Publisher<Payload>

Stream of request payloads.

Returns:Flux<Payload>

Stream of response payloads.

Annotations
@Override
requestResponseback to summary
public Mono<Payload> requestResponse(Payload payload)

Overrides default io.rsocket.RSocket.requestResponse.

Doc from io.rsocket.RSocket.requestResponse.

Request-Response interaction model of RSocket.

Parameters
payload:Payload

Request payload.

Returns:Mono<Payload>

Publisher containing at most a single Payload representing the response.

Annotations
@Override
requestStreamback to summary
public Flux<Payload> requestStream(Payload payload)

Overrides default io.rsocket.RSocket.requestStream.

Doc from io.rsocket.RSocket.requestStream.

Request-Stream interaction model of RSocket.

Parameters
payload:Payload

Request payload.

Returns:Flux<Payload>

Publisher containing the stream of Payloads representing the response.

Annotations
@Override
retainDataAndReleasePayloadback to summary
private DataBuffer retainDataAndReleasePayload(Payload payload)