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
returned 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.
|
ReturnedMessage |
getReturned()
Get the returned message and metadata, if any.
|
Message |
getReturnedMessage()
Deprecated.
in favor of
getReturned(). |
void |
setId(String id)
Set the correlation id.
|
void |
setReturned(ReturnedMessage returned)
Set the returned message and metadata.
|
void |
setReturnedMessage(Message returnedMessage)
Deprecated.
in favor of
setReturned(ReturnedMessage). |
String |
toString() |
public CorrelationData()
public String getId()
public void setId(String id)
MessagePostProcessor.id - the id.public SettableListenableFuture<CorrelationData.Confirm> getFuture()
@Deprecated @Nullable public Message getReturnedMessage()
getReturned().id. Guaranteed to be populated before the future
is set.@Deprecated public void setReturnedMessage(Message returnedMessage)
setReturned(ReturnedMessage).returnedMessage - the returned message.@Nullable public ReturnedMessage getReturned()
ReturnedMessage.public void setReturned(ReturnedMessage returned)
returned - the ReturnedMessage.