Convert AMQP 091 timestamp to millisecond

For start offset in stream queue.
This commit is contained in:
Arnaud Cogoluègnes 2020-11-27 14:47:36 +01:00
parent f23a51261d
commit 43cfb45a74
No known key found for this signature in database
GPG Key ID: D5C8C4DFAD43AFA8
2 changed files with 3 additions and 3 deletions

View File

@ -183,7 +183,7 @@ consume(Q, Spec, QState0) when ?amqqueue_is_stream(Q) ->
{_, <<"next">>} ->
next;
{timestamp, V} ->
{timestamp, V};
{timestamp, V * 1000};
{_, V} ->
V
end,

View File

@ -619,7 +619,7 @@ consume_timestamp_offset(Config) ->
Ch1 = rabbit_ct_client_helpers:open_channel(Config, Server),
qos(Ch1, 10, false),
Offset = erlang:system_time(millisecond) - 600000,
Offset = erlang:system_time(second) - 60,
amqp_channel:subscribe(
Ch1,
#'basic.consume'{queue = Q,
@ -653,7 +653,7 @@ consume_timestamp_last_offset(Config) ->
qos(Ch1, 10, false),
%% Subscribe from now/future
Offset = erlang:system_time(millisecond) + 60000,
Offset = erlang:system_time(second) + 60,
amqp_channel:subscribe(
Ch1,
#'basic.consume'{queue = Q,