public interface MessageSink<M,D> extends ChannelSink<ChannelMessage<M,D>>
ChannelMessage
,
MessageSource
Modifier and Type | Method and Description |
---|---|
default ChannelSink<D> |
asDataSink()
Builds a channel sink that uses this message sink to consume data items
D . |
static <M,D> MessageSink<M,D> |
forwardDataTo(ChannelSink<D> target)
Builds a message sink that forwards message data to the given consumer,
while discarding any message metadata.
|
consume
static <M,D> MessageSink<M,D> forwardDataTo(ChannelSink<D> target)
M
- the metadata type.D
- the data type.target
- consumes message data.java.lang.NullPointerException
- if the argument is null
.default ChannelSink<D> asDataSink()
D
. The messages forwarded to the underlying consumer will all
have empty metadata as any received metadata is discarded.