Skip to content

Commit

Permalink
Merge pull request #951 from Annopaolo/trigger-policy-ttl-in-seconds
Browse files Browse the repository at this point in the history
Trigger policy TTL in seconds, also in release-1.1
  • Loading branch information
davidebriani authored May 27, 2024
2 parents 3a0dafc + 3c4636d commit e90a68e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
in payloads).
- [astarte_data_updater_plant] do not leak consumer channels in corner cases.
- [astarte_data_updater_plant] do not leak producer channels in corner cases.
- [astarte_trigger_engine] Always treat event TTL for trigger policies in seconds,
not milliseconds.

## [1.1.1] - 2023-11-15
### Fixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,8 @@ defmodule Astarte.TriggerEngine.AMQPConsumer.AMQPMessageConsumer do
}) do
[]
|> put_x_arg_if(maximum_capacity != nil, {"x-max-length", :signedint, maximum_capacity})
|> put_x_arg_if(event_ttl != nil, {"x-message-ttl", :signedint, event_ttl})
# AMQP message TTLs are in milliseconds!
|> put_x_arg_if(event_ttl != nil, {"x-message-ttl", :signedint, event_ttl * 1_000})
end

defp put_x_arg_if(list, true, x_arg), do: [x_arg | list]
Expand Down
2 changes: 1 addition & 1 deletion doc/pages/architecture/062-trigger_delivery_policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ A Trigger Delivery Policy is composed of:
This is optional, but required if the policy specifies at least one handler with retry strategy.

- Event TTL: in order to further lower the space requirement of the event queue, events may be equipped with a TTL which specifies the amount of
milliseconds an event is retained in the event queue. When an event expires, it is discarded from the event queue, even if it has not been
seconds an event is retained in the event queue. When an event expires, it is discarded from the event queue, even if it has not been
delivered. This is optional.


Expand Down

0 comments on commit e90a68e

Please sign in to comment.