com.solace.spring.cloud.stream.binder.util.MessageContainer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of spring-cloud-stream-binder-solace Show documentation
Show all versions of spring-cloud-stream-binder-solace Show documentation
A Spring Cloud Stream Binder implementation using the Solace Java API (JCSMP)
The newest version!
package com.solace.spring.cloud.stream.binder.util;
import com.solacesystems.jcsmp.BytesXMLMessage;
import java.util.StringJoiner;
import java.util.UUID;
import java.util.concurrent.atomic.AtomicBoolean;
public class MessageContainer {
private final UUID id = UUID.randomUUID();
private final BytesXMLMessage message;
private final UUID flowReceiverReferenceId;
private final AtomicBoolean staleFlag;
private boolean acknowledged;
MessageContainer(BytesXMLMessage message, UUID flowReceiverReferenceId, AtomicBoolean staleFlag) {
this.message = message;
this.flowReceiverReferenceId = flowReceiverReferenceId;
this.staleFlag = staleFlag;
}
public UUID getId() {
return id;
}
public BytesXMLMessage getMessage() {
return message;
}
public UUID getFlowReceiverReferenceId() {
return flowReceiverReferenceId;
}
public boolean isAcknowledged() {
return acknowledged;
}
public boolean isStale() {
return staleFlag.get();
}
void setAcknowledged(boolean acknowledged) {
this.acknowledged = acknowledged;
}
@Override
public String toString() {
return new StringJoiner(", ", MessageContainer.class.getSimpleName() + "[", "]")
.add("id=" + id)
.add("message=" + message)
.add("flowReceiverReferenceId=" + flowReceiverReferenceId)
.add("staleFlag=" + staleFlag)
.add("acknowledged=" + acknowledged)
.toString();
}
}