0

lets say I have two threads which want to communicate using the same Chronicle queue, writer:

            SingleChronicleQueue queue_en = SingleChronicleQueueBuilder.binary(path).build();
            ExcerptAppender appender = queue_en.acquireAppender();
            ....

reader:

            SingleChronicleQueue queue_en = SingleChronicleQueueBuilder.binary(path).build();
            ExcerptTailer tailer = queue_en.createTailer();
            ...

now when I start my application I got:

[Thread-1] n.o.c.q.i.t.SingleTableStore             Failed to acquire a lock on the table store file. Retrying
Exception in thread "Thread-1" java.lang.NoSuchMethodError: net.openhft.chronicle.core.util.Time.sleep(JLjava/util/concurrent/TimeUnit;)V
    at net.openhft.chronicle.queue.impl.table.SingleTableStore.doWithExclusiveLock(SingleTableStore.java:153)
    at net.openhft.chronicle.queue.impl.table.SingleTableBuilder.build(SingleTableBuilder.java:111)
    at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder.initializeMetadata(SingleChronicleQueueBuilder.java:430)
    at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder.preBuild(SingleChronicleQueueBuilder.java:995)
    at net.openhft.chronicle.queue.impl.single.SingleChronicleQueueBuilder.build(SingleChronicleQueueBuilder.java:328)
    at 
....

may I ask you how to do it correctly ?

1 Answers1

1

This means you are using an incompatible version of core with queue

I suggest you use a chronicle-bom to ensure all the versions were tested together.

Here is an example from

https://github.com/OpenHFT/Chronicle-Queue-Demo/tree/master/order-processor

<dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>third-party-bom</artifactId>
            <type>pom</type>
            <version>3.6.15</version>
            <scope>import</scope>
        </dependency>
        <dependency>
            <groupId>net.openhft</groupId>
            <artifactId>chronicle-bom</artifactId>
            <version>2.17.482</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
    </dependencies>
</dependencyManagement>

<dependencies>
    <dependency>
        <groupId>net.openhft</groupId>
        <artifactId>chronicle-queue</artifactId>
    </dependency>
Peter Lawrey
  • 525,659
  • 79
  • 751
  • 1,130