Package io.aeron.cluster.client
Interface EgressListener
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Interface for consuming messages coming from the cluster that also include administrative events.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonAdminResponse(long clusterSessionId, long correlationId, io.aeron.cluster.codecs.AdminRequestType requestType, io.aeron.cluster.codecs.AdminResponseCode responseCode, String message, DirectBuffer payload, int payloadOffset, int payloadLength) Message returned in response to an admin request.voidonMessage(long clusterSessionId, long timestamp, DirectBuffer buffer, int offset, int length, Header header) Message returned from the clustered service.default voidonNewLeader(long clusterSessionId, long leadershipTermId, int leaderMemberId, String ingressEndpoints) Event indicating a new leader has been elected.default voidonSessionEvent(long correlationId, long clusterSessionId, long leadershipTermId, int leaderMemberId, io.aeron.cluster.codecs.EventCode code, String detail) Session event emitted from the cluster which after connect can indicate an error or session close.
-
Method Details
-
onMessage
void onMessage(long clusterSessionId, long timestamp, DirectBuffer buffer, int offset, int length, Header header) Message returned from the clustered service.- Parameters:
clusterSessionId- to which the message belongs.timestamp- at which the correlated ingress was sequenced in the cluster.buffer- containing the message.offset- at which the message begins.length- of the message in bytes.header- Aeron header associated with the message fragment.
-
onSessionEvent
default void onSessionEvent(long correlationId, long clusterSessionId, long leadershipTermId, int leaderMemberId, io.aeron.cluster.codecs.EventCode code, String detail) Session event emitted from the cluster which after connect can indicate an error or session close.- Parameters:
correlationId- associated with the cluster ingress.clusterSessionId- to which the event belongs.leadershipTermId- for identifying the active term of leadershipleaderMemberId- identity of the active leader.code- to indicate the type of event.detail- Textual detail to explain the event.
-
onNewLeader
default void onNewLeader(long clusterSessionId, long leadershipTermId, int leaderMemberId, String ingressEndpoints) Event indicating a new leader has been elected.- Parameters:
clusterSessionId- to which the event belongs.leadershipTermId- for identifying the active term of leadershipleaderMemberId- identity of the active leader.ingressEndpoints- for connecting to the cluster.
-
onAdminResponse
default void onAdminResponse(long clusterSessionId, long correlationId, io.aeron.cluster.codecs.AdminRequestType requestType, io.aeron.cluster.codecs.AdminResponseCode responseCode, String message, DirectBuffer payload, int payloadOffset, int payloadLength) Message returned in response to an admin request.- Parameters:
clusterSessionId- to which the response belongs.correlationId- of the admin request.requestType- of the admin request.responseCode- describing the response.message- describing the response (e.g. error message).payload- delivered with the response, can be empty.payloadOffset- into the payload buffer.payloadLength- of the payload.
-