Class PubSubAcknowledgmentCallback
java.lang.Object
com.google.cloud.spring.pubsub.integration.inbound.PubSubAcknowledgmentCallback
- All Implemented Interfaces:
org.springframework.integration.acks.AcknowledgmentCallback,org.springframework.integration.acks.SimpleAcknowledgment
public class PubSubAcknowledgmentCallback
extends Object
implements org.springframework.integration.acks.AcknowledgmentCallback
Pub/Sub specific implementation of
AcknowledgmentCallback.
AcknowledgmentCallback.isAcknowledged() is implemented for semantic accuracy only,
since in Pub/Sub acknowledging a message more than once is not an error.
AcknowledgmentCallback.noAutoAck() is not implemented; the correct way to enable
manual acking is through configuring PubSubMessageSource.
- Since:
- 1.2
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.springframework.integration.acks.AcknowledgmentCallback
org.springframework.integration.acks.AcknowledgmentCallback.Status -
Constructor Summary
ConstructorsConstructorDescriptionPubSubAcknowledgmentCallback(AcknowledgeablePubsubMessage message, AckMode ackMode) Instantiates a callback for a given message and acknowledgement mode. -
Method Summary
Modifier and TypeMethodDescriptionvoidacknowledge(org.springframework.integration.acks.AcknowledgmentCallback.Status status) InAckMode.AUTO_ACKmode, nacking cannot be done through this callback.booleanbooleanMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.integration.acks.AcknowledgmentCallback
acknowledge, noAutoAck
-
Constructor Details
-
PubSubAcknowledgmentCallback
Instantiates a callback for a given message and acknowledgement mode.- Parameters:
message- message to acknowledgeackMode- whether to ack and/or nack automatically
-
-
Method Details
-
acknowledge
public void acknowledge(org.springframework.integration.acks.AcknowledgmentCallback.Status status) InAckMode.AUTO_ACKmode, nacking cannot be done through this callback.Use
GcpPubSubHeaders.ORIGINAL_MESSAGEto nack instead.- Specified by:
acknowledgein interfaceorg.springframework.integration.acks.AcknowledgmentCallback
-
isAutoAck
public boolean isAutoAck()- Specified by:
isAutoAckin interfaceorg.springframework.integration.acks.AcknowledgmentCallback
-
isAcknowledged
public boolean isAcknowledged()- Specified by:
isAcknowledgedin interfaceorg.springframework.integration.acks.AcknowledgmentCallback
-