package town.lost.processor.events;

import net.openhft.chronicle.bytes.MethodReader;
import net.openhft.chronicle.queue.ChronicleQueue;

public class BridgeMain {
    static boolean running = true;

    public static void main(String[] args) {
        long events = 0, lastPrint = 0;
        try (ChronicleQueue queue = ChronicleQueue.singleBuilder("in").sourceId(1).build()) {
            try (ChronicleQueue queue2 = ChronicleQueue.singleBuilder("out").sourceId(2).build()) {

                Events out = queue2.methodWriterBuilder(Events.class).recordHistory(true).build();
                Events bridge = new BridgeEvents(out);
                MethodReader methodReader = queue.createTailer().methodReader(bridge);
                while (running) {
                    if (methodReader.readOne()) {
                        events++;
                    } else {
                        if (lastPrint != events) {
                            System.out.println("events: " + events);
                            lastPrint = events;
                        } else {
                            Thread.yield();
                        }
                    }
                }
            }
        }
    }
}

class BridgeEvents implements Events {
    final Events out;

    public BridgeEvents(Events out) {
        this.out = out;
    }

    @Override
    public void eventOne(EventOne one) {
        out.eventOne(one);
        if (one.text().equalsIgnoreCase("Bye"))
            BridgeMain.running = false;
    }

    @Override
    public void eventTwo(EventTwo two) {
        out.eventTwo(two);
    }
}

@@ -710,24 +710,71 @@
 er(bridge);%0A
+                System.out.println(%22Started%22);%0A
             
@@ -1239,24 +1239,68 @@
 %7D%0A        %7D%0A
+        System.out.println(%22... finished%22);%0A
     %7D%0A%7D%0A%0Acla

Add some logs