| Modifier and Type | Method and Description |
|---|---|
CompletionStage<Void> |
ack()
Acknowledge this message.
|
Supplier<CompletionStage<Void>> |
getAck() |
Metadata |
getMetadata() |
T |
getPayload() |
<C> C |
unwrap(Class<C> unwrapType)
Returns an object of the specified type to allow access to the connector-specific
Message implementation,
and other classes. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddMetadata, getMetadata, getNack, nack, nack, of, of, of, of, of, of, of, of, of, withAck, withMetadata, withMetadata, withNack, withPayloadpublic T getPayload()
getPayload in interface Message<T>public Supplier<CompletionStage<Void>> getAck()
getAck in interface Message<T>CompletionStage.public CompletionStage<Void> ack()
Messagepublic Metadata getMetadata()
getMetadata in interface Message<T>public <C> C unwrap(Class<C> unwrapType)
MessageMessage implementation,
and other classes. For example, a Kafka connector could implement this method to allow unwrapping to a specific
Kafka message implementation, or to ConsumerRecord and ProducerRecord. If the Message
implementation does not support the target class, an IllegalArgumentException should be raised.
The default implementation tries to cast the current Message instance to the target class.
When a connector provides its own Message implementation, it should override this method to support
specific types.
Copyright © 2018–2021 SmallRye. All rights reserved.