chroniclechronicle-queue

Chronicle Queue rolltime


I am considering configuring a non-default rollTime for chronicle-queue.

The rollTime() method allows the ability for the queue rolltime to take account user specified timezone/time.

This method can be called by both producers of the queue and consumers when accessing the queue. Producers and consumers can be started in any order.

What determines the active rolltime setting if different rolltime settings are specified when accessing the queue.

What happens


Solution

  • if producer and consumer of queue specify different rolltime ?

    The consumer reads what is there, if it sets a different cycle or roll time it doesn't matter. A warning is produced if they are different. The consumer doesn't need to set these otherwise.

    if producer is restarted with a different rolltime ?

    It will write to the last roll cycle unless it would write to a newer roll cycle. i.e. if you set it backwards, it won't do anything if the current roll cycle exists.

    if multi-producers to same queue specify different rolltimes ?

    If the producer which would roll sooner, writes a message, it can trigger a roll and any other producer will be forced to the new cycle. If you have a producer that doesn't write, it has no impact.

    If the queue is replicated. Is the rolltime setting setting the same for both source and syncs (queue files are always identical) or is it possible for the syncs to have a different rolltime ?

    The sync replicated whatever the source sets. The indexes and roll cycles are preserved. The roll for the sync only matters if it becomes the source later.