public class CorrelationData extends Object implements Correlation
RabbitTemplate
methods that include one of
these as a parameter; when the publisher confirm is received, the CorrelationData is
returned with the ack/nack. When returns are also enabled, the
returnedMessage
property will be populated when a
message can't be delivered - the return always arrives before the confirmation. In this
case the #id
property must be set to a unique value. If no id is provided it
will automatically set to a unique value.Modifier and Type | Class and Description |
---|---|
static class |
CorrelationData.Confirm
Represents a publisher confirmation.
|
Constructor and Description |
---|
CorrelationData()
Construct an instance with a null Id.
|
CorrelationData(String id)
Construct an instance with the supplied id.
|
Modifier and Type | Method and Description |
---|---|
SettableListenableFuture<CorrelationData.Confirm> |
getFuture()
Return a future to check the success/failure of the publish operation.
|
String |
getId()
Return the id.
|
Message |
getReturnedMessage()
Return a returned message, if any; requires a unique
id . |
void |
setId(String id)
Set the correlation id.
|
void |
setReturnedMessage(Message returnedMessage)
Set a returned message for this correlation data.
|
String |
toString() |
public CorrelationData()
public CorrelationData(String id)
returnedMessage
.id
- the id.public String getId()
public void setId(String id)
MessagePostProcessor
.id
- the id.public SettableListenableFuture<CorrelationData.Confirm> getFuture()
@Nullable public Message getReturnedMessage()
id
. Guaranteed to be populated before the future
is set.public void setReturnedMessage(Message returnedMessage)
returnedMessage
- the returned message.