use of io.aeron.archive.ArchivingMediaDriver in project aeron by real-logic.
the class ArchiveLoggingAgentTest method testArchiveLogging.
@SuppressWarnings("try")
private void testArchiveLogging(final String enabledEvents, final EnumSet<ArchiveEventCode> expectedEvents) {
before(enabledEvents, expectedEvents);
final MediaDriver.Context mediaDriverCtx = new MediaDriver.Context().errorHandler(Tests::onError).dirDeleteOnStart(true).threadingMode(ThreadingMode.SHARED);
final AeronArchive.Context aeronArchiveContext = new AeronArchive.Context().controlRequestChannel("aeron:udp?term-length=64k|endpoint=localhost:8010").controlRequestStreamId(100).controlResponseChannel("aeron:udp?term-length=64k|endpoint=localhost:0").controlResponseStreamId(101);
final Archive.Context archiveCtx = new Archive.Context().errorHandler(Tests::onError).archiveDir(new File(testDir, "archive")).deleteArchiveOnStart(true).recordingEventsEnabled(false).controlChannel(aeronArchiveContext.controlRequestChannel()).controlStreamId(aeronArchiveContext.controlRequestStreamId()).localControlStreamId(aeronArchiveContext.controlRequestStreamId()).recordingEventsChannel(aeronArchiveContext.recordingEventsChannel()).threadingMode(ArchiveThreadingMode.SHARED);
try (ArchivingMediaDriver ignore1 = ArchivingMediaDriver.launch(mediaDriverCtx, archiveCtx)) {
try (AeronArchive ignore2 = AeronArchive.connect(aeronArchiveContext)) {
Tests.await(WAIT_LIST::isEmpty);
}
}
}
Aggregations