S
- type of message that will be sent by the producersT
- type of message that will be received by the consumerspublic interface SinkModule<S extends Message,T extends Message>
AggregationPolicy
.
If aggregation is not used, the message type sent by the producers must match
the message type received by the consumers.Modifier and Type | Field and Description |
---|---|
static String |
HEARTBEAT_MODULE_ID |
Modifier and Type | Method and Description |
---|---|
AggregationPolicy<S,T,?> |
getAggregationPolicy()
Defines how messages should be combined, and when they
should be "released".
|
AsyncPolicy |
getAsyncPolicy()
Defines how messages should be asynchronously dispatched.
|
String |
getId()
Globally unique identifier.
|
int |
getNumConsumerThreads()
The number of threads used to consume from the broker.
|
default Optional<String> |
getRoutingKey(T message)
Thr routing key will be used to ensure all messages of the same group is handled by the same consumer.
|
byte[] |
marshal(T message)
Marshals the aggregated message to a byte array.
|
byte[] |
marshalSingleMessage(S message)
Marshals single message to a byte array.
|
T |
unmarshal(byte[] message)
Unmarshals the aggregated message from a byte array.
|
S |
unmarshalSingleMessage(byte[] message)
Unmarshals single message from a byte array.
|
static final String HEARTBEAT_MODULE_ID
String getId()
int getNumConsumerThreads()
byte[] marshal(T message)
T unmarshal(byte[] message)
byte[] marshalSingleMessage(S message)
S unmarshalSingleMessage(byte[] message)
AggregationPolicy<S,T,?> getAggregationPolicy()
null
.AggregationPolicy
used to combine messages, or null
if the messages should not be combined.AsyncPolicy getAsyncPolicy()
AsyncPolicy
used when asynchronously dispatching
messages for this module.default Optional<String> getRoutingKey(T message)
message
- the message to generate the routing key fromOptional.empty()
if no routing is requiredCopyright © 2020. All rights reserved.