public final class IngressSessionDecorator extends Object
The client message header is applied to the Publication before the offered buffer.
Note: This class is NOT threadsafe for updating clusterSessionId(long) or
leadershipTermId(long). Each publisher thread requires its own instance.
| Modifier and Type | Field and Description |
|---|---|
static int |
HEADER_LENGTH
Length of the session header that will be prepended to the message.
|
| Constructor and Description |
|---|
IngressSessionDecorator()
Construct a new ingress session header wrapper that defaults all fields to
Aeron.NULL_VALUE. |
IngressSessionDecorator(long clusterSessionId,
long leadershipTermId)
Construct a new session header wrapper.
|
| Modifier and Type | Method and Description |
|---|---|
IngressSessionDecorator |
clusterSessionId(long clusterSessionId)
Reset the cluster session id in the header.
|
IngressSessionDecorator |
leadershipTermId(long leadershipTermId)
Reset the leadership term id in the header.
|
long |
offer(Publication publication,
DirectBuffer buffer,
int offset,
int length)
Non-blocking publish of a partial buffer containing a message plus session header to a cluster.
|
public static final int HEADER_LENGTH
public IngressSessionDecorator()
Aeron.NULL_VALUE.public IngressSessionDecorator(long clusterSessionId,
long leadershipTermId)
clusterSessionId - that has been allocated by the cluster.leadershipTermId - of the current leader.public IngressSessionDecorator clusterSessionId(long clusterSessionId)
clusterSessionId - to be set in the header.public IngressSessionDecorator leadershipTermId(long leadershipTermId)
leadershipTermId - to be set in the header.public long offer(Publication publication, DirectBuffer buffer, int offset, int length)
This version of the method will set the timestamp value in the header to Aeron.NULL_VALUE.
publication - to be offered to.buffer - containing message.offset - offset in the buffer at which the encoded message begins.length - in bytes of the encoded message.Publication.offer(DirectBuffer, int, int).Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.