예제 #1
0
        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));
        }
예제 #2
0
        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();
            }
        }
예제 #3
0
        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})");
        }
예제 #4
0
        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})");
        }