public class BasicAuctionClusterClient extends Object implements EgressListener
BasicAuctionClusteredService.| Constructor and Description |
|---|
BasicAuctionClusterClient(long customerId,
int numOfBids,
int bidIntervalMs)
Construct a new cluster client for the auction.
|
| Modifier and Type | Method and Description |
|---|---|
static String |
ingressEndpoints(List<String> hostnames)
Ingress endpoints generated from a list of hostnames.
|
static void |
main(String[] args)
Main method for launching the process.
|
void |
onMessage(long clusterSessionId,
long timestamp,
DirectBuffer buffer,
int offset,
int length,
Header header)
Message returned from the clustered service.
|
void |
onNewLeader(long clusterSessionId,
long leadershipTermId,
int leaderMemberId,
String ingressEndpoints)
Event indicating a new leader has been elected.
|
void |
onSessionEvent(long correlationId,
long clusterSessionId,
long leadershipTermId,
int leaderMemberId,
EventCode code,
String detail)
Session event emitted from the cluster which after connect can indicate an error or session close.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonAdminResponsepublic BasicAuctionClusterClient(long customerId,
int numOfBids,
int bidIntervalMs)
customerId - for the client.numOfBids - to make as a client.bidIntervalMs - between the bids.public void onMessage(long clusterSessionId,
long timestamp,
DirectBuffer buffer,
int offset,
int length,
Header header)
onMessage in interface EgressListenerclusterSessionId - 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.public void onSessionEvent(long correlationId,
long clusterSessionId,
long leadershipTermId,
int leaderMemberId,
EventCode code,
String detail)
onSessionEvent in interface EgressListenercorrelationId - 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.public void onNewLeader(long clusterSessionId,
long leadershipTermId,
int leaderMemberId,
String ingressEndpoints)
onNewLeader in interface EgressListenerclusterSessionId - to which the event belongs.leadershipTermId - for identifying the active term of leadershipleaderMemberId - identity of the active leader.ingressEndpoints - for connecting to the cluster which can be updated due to dynamic membership.public static String ingressEndpoints(List<String> hostnames)
hostnames - for the cluster members.public static void main(String[] args)
args - passed to the process.Copyright © 2014-2023 Real Logic Limited. All Rights Reserved.