io.smallrye.reactive.messaging.OutgoingMessageMetadata Maven / Gradle / Ivy
package io.smallrye.reactive.messaging;
import org.eclipse.microprofile.reactive.messaging.Message;
/**
* Metadata injected for holding the result of outgoing connector's transmission operation
*
* Connector implementations are responsible for searching for this metadata on the outgoing message
* and setting the transmission result on that metadata object.
*
* Implementations of {@link OutgoingInterceptor} can access the result
* on {@link OutgoingInterceptor#onMessageAck(Message)} callback.
*
* @param type of the transmission result
*/
public class OutgoingMessageMetadata {
private T result;
public static void setResultOnMessage(Message> message, Object result) {
message.getMetadata(OutgoingMessageMetadata.class).ifPresent(m -> m.setResult(result));
}
public void setResult(T result) {
this.result = result;
}
public T getResult() {
return result;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy