Package io.smallrye.reactive.messaging
Interface TargetedMessages
- All Known Implementing Classes:
TargetedMessages.Default
Container of
Message
s to send multiple messages to different channels
The TargetedMessages.Default
implementation holds channel-message mappings in an unmodifiable Map
.
This implementation returns the inner map from the Message.getPayload()
-
Nested Class Summary
-
Field Summary
Fields inherited from interface org.eclipse.microprofile.reactive.messaging.Message
EMPTY_ACK, EMPTY_NACK, LOGGER
-
Method Summary
Modifier and TypeMethodDescriptionstatic TargetedMessages
static TargetedMessages
Message<?>
Return the message associated with the given channelstatic TargetedMessages
static TargetedMessages
static TargetedMessages
static TargetedMessages
of
(String c1, Message<?> m1, String c2, Message<?> m2, String c3, Message<?> m3, String c4, Message<?> m4) static TargetedMessages
of
(String c1, Message<?> m1, String c2, Message<?> m2, String c3, Message<?> m3, String c4, Message<?> m4, String c5, Message<?> m5) static TargetedMessages
of
(String c1, Message<?> m1, String c2, Message<?> m2, String c3, Message<?> m3, String c4, Message<?> m4, String c5, Message<?> m5, String c6, Message<?> m6) Add a new mapping to this target mapping.withMessage
(String channel, Message<?> message) Add a new mapping to this target mapping.Methods inherited from interface org.eclipse.microprofile.reactive.messaging.Message
ack, ack, addMetadata, getAck, getAckWithMetadata, getMetadata, getMetadata, getNack, getNackWithMetadata, getPayload, nack, nack, thenApply, unwrap, withAck, withAckWithMetadata, withMetadata, withMetadata, withNack, withNackWithMetadata, withPayload
-
Method Details
-
from
- Parameters:
payloads
-- Returns:
-
from
-
of
-
of
-
of
-
of
-
of
-
of
-
get
Return the message associated with the given channel- Parameters:
channel
- the channel name- Returns:
- the
Message
associated with the channel. Returnsnull
if this mapping does not contain the given channel.
-
withMessage
Add a new mapping to this target mapping. It returns a newTargetedMessages
instance.- Parameters:
channel
- the channel to addmessage
- the message to add- Returns:
- a new instance of
TargetedMessages
-
with
Add a new mapping to this target mapping. If the given object is not an instance ofMessage
, it'll be wrapped as a message- Parameters:
channel
- the channel to addpayloadOrMessage
- the payload or message to add- Returns:
- a new instance of
Targeted
-