Skip to content

Latest commit

 

History

History
46 lines (31 loc) · 1.84 KB

timezone_rollover.adoc

File metadata and controls

46 lines (31 loc) · 1.84 KB

Timezone Queue Rollover (Enterprise Edition Feature)

In Chronicle Queue, the time at which queues are rolled over is based on the UTC time; Chronicle Queue uses System.currentTimeMillis().

The Timezone Rollover Enterprise feature extends Chronicle Queue’s ability to specify the time and periodicity of queue rollovers, to take account of the user’s location timezone, rather than UTC.

Note
This feature is only relevant to daily rollovers where RollCycle is one of: - SMALL_DAILY - DAILY - LARGE_DAILY - XLARGE_DAILY - HUGE_DAILY

Syntax

rollTime and rollTimeZone can be set on the SingleChronicleQueueBuilder using the below setters:

    public SingleChronicleQueueBuilder rollTime(@NotNull final LocalTime rollTime);

    public SingleChronicleQueueBuilder rollTimeZone(@NotNull final ZoneId rollTimeZone);

    public SingleChronicleQueueBuilder rollTime(@NotNull final LocalTime rollTime, @NotNull final ZoneId zoneId);
Note
rollTime() allows the rollover time of the cycle file to be controlled in both Chronicle Queue open-source and Chronicle QueueEnterprise Edition.
If this is used with in the open-source version, any zoneId other than UTC will be converted to UTC, and a warning message logged.

Examples

The following code extract is an instruction to use Europe/London as time zone, and rolls over queues at midnight regardless of offset to UTC - periodic time zone changes e.g. in the transition from winter to/from summer will be respected.

.rollTime(LocalTime.of(0, 0), ZoneId.of("Europe/London"))

The following code extract is an instruction to use America/New_York as time zone, and rolls over queues at midnight regardless of offset to UTC.

.rollTime(LocalTime.of(17, 0), ZoneId.of("America/New_York"))