Interface BaseMessageRequest
- All Superinterfaces:
BaseRequest
- All Known Subinterfaces:
HttpMessageRequest,HttpRequest,MessageRequest,Request
Represents a request that can manipulate a flow of messages.
- Author:
- Jeoffrey HAEYAERT (jeoffrey.haeyaert at graviteesource.com), GraviteeSource Team
-
Method Summary
Modifier and TypeMethodDescriptionio.reactivex.rxjava3.core.Flowable<Message>messages()Get the request message flow as aFlowableofMessage.voidSet the request message flow.default io.reactivex.rxjava3.core.CompletableApplies a given transformation on each message.io.reactivex.rxjava3.core.CompletableonMessages(io.reactivex.rxjava3.core.FlowableTransformer<Message, Message> onMessages) Applies a given transformation on each message.
-
Method Details
-
messages
io.reactivex.rxjava3.core.Flowable<Message> messages()Get the request message flow as aFlowableofMessage. WARN: you should not keep a direct reference on the message flow as it could be overridden by others at anytime.- Returns:
- a
FlowableofMessage.
-
messages
Set the request message flow. WARN:- Replacing the message flow DOES NOT take care of the previous message flow in place.
- You MUST ensure to consume the previous message flow when using it.
- You SHOULD consider using
onMessages(FlowableTransformer)oronMessage(Function)that may be more appropriate for message transformation.
-
onMessages
io.reactivex.rxjava3.core.Completable onMessages(io.reactivex.rxjava3.core.FlowableTransformer<Message, Message> onMessages) Applies a given transformation on each message. Ex:request.onMessages(messages -> messages.flatMap(message -> transformMyMessage(message)));- Parameters:
onMessages- the transformer that will be applied on each message.- Returns:
- a
Completablethat completes once the message transformation has been set up on the message flow (not executed).
-
onMessage
default io.reactivex.rxjava3.core.Completable onMessage(Function<Message, io.reactivex.rxjava3.core.Maybe<Message>> onMessage) Applies a given transformation on each message. Ex: Discard a message:request.onMessage(message -> Maybe.empty());Update a message:request.onMessage(message -> transformMyMessage(message));- Parameters:
onMessage- the transformer that will be applied on each message.- Returns:
- a
Completablethat completes once the message transformation has been set up on the message flow (not executed).
-