public void OnMessage(long correlationId, long clusterSessionId, long timestampMs, IDirectBuffer buffer, int offset, int length, Header header) { Console.WriteLine($"OnMessage: sessionId={clusterSessionId}, timestamp={timestampMs}, correlationId={correlationId}, length={length}"); Console.WriteLine("Received Message: " + buffer.GetStringWithoutLengthUtf8(offset, length)); }
public void OnSessionMessage(ClientSession session, long correlationId, long timestampMs, IDirectBuffer buffer, int offset, int length, Header header) { Console.WriteLine($"OnSessionMessage: sessionId={session.Id()}, timestamp={timestampMs}, correlationId={correlationId}, length={length}"); Console.WriteLine("Received Message: " + buffer.GetStringWithoutLengthUtf8(offset, length)); while (session.Offer(correlationId, buffer, offset, length) <= 0) { _cluster.Idle(); } }
private static void PrintMessage(IDirectBuffer buffer, int offset, int length, Header header) { var message = buffer.GetStringWithoutLengthUtf8(offset, length); Console.WriteLine($"Received message ({message}) to stream {header.StreamId:D} from session {header.SessionId:x} term id {header.TermId:x} term offset {header.TermOffset:D} ({length:D}@{offset:D})"); }
static void PrintMessage(IDirectBuffer buffer, int offset, int length, Header header) { var message = buffer.GetStringWithoutLengthUtf8(offset, length); Console.WriteLine($"Received message ({message}) to stream {header.StreamId:D} from session {header.SessionId:x} term id {header.TermId:x} term offset {header.TermOffset:D} ({length:D}@{offset:D})"); }