Interface PublishAcknowledgmentProvider
public interface PublishAcknowledgmentProvider
Create this as a bean to inject a custom provider that will be used to notify the Connector Framework of when messages have been successfully/unsuccessfully published.
Mainly to be used when working with existing binders.
-
Method Summary
Modifier and TypeMethodDescriptionThe type of the publishing binder.createFuture(org.springframework.messaging.support.MessageHeaderAccessor headerAccessor, Object payload) Create aCompletableFutureto indicate when a published message has been successfully/unsuccessfully delivered.
-
Method Details
-
binderType
String binderType()The type of the publishing binder.- Returns:
- the binder type
-
createFuture
CompletableFuture<Void> createFuture(org.springframework.messaging.support.MessageHeaderAccessor headerAccessor, Object payload) Create a
CompletableFutureto indicate when a published message has been successfully/unsuccessfully delivered.Note: This method will only be invoked once, before handing the message off to output bindings. So if the binder's publish acknowledgment mechanism still uses the deprecated
ListenableFuture, then this can be safely converted here usingListenableFuture.completable().- Parameters:
headerAccessor- the header accessor to which publish acknowledgment headers (if any) can be injectedpayload- the message payload- Returns:
- the publish acknowledgment future
-