JuliaComputing / AMQPClient.jl

A Julia AMQP (Advanced Message Queuing Protocol) / RabbitMQ Client.
Other
39 stars 21 forks source link

allow using tcp keepalives instead of heartbeats #47

Closed tanmaykm closed 2 years ago

tanmaykm commented 2 years ago

AMQP allows heartbeats to be disabled completely, provided the server allows that. But it is essential to have an alternative to detect network disconnections and stale connections. In this PR, we switch on TCP keepalives on the connection (optional but enabled by default) and allow heartbeats to be switched off. Heartbeats are still enabled by default though.

The connection method has these new parameters to allow that:

connection(;
    heartbeat = true,
    keepalive = DEFAULT_KEEPALIVE_SECS,
)
codecov-commenter commented 2 years ago

Codecov Report

Merging #47 (655ac4a) into master (6145773) will decrease coverage by 0.16%. The diff coverage is 94.11%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
- Coverage   82.18%   82.02%   -0.17%     
==========================================
  Files           9        9              
  Lines        1016     1029      +13     
==========================================
+ Hits          835      844       +9     
- Misses        181      185       +4     
Impacted Files Coverage Δ
src/protocol.jl 86.83% <94.11%> (-0.21%) :arrow_down:
src/types.jl 96.31% <0.00%> (-0.60%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 6145773...655ac4a. Read the comment docs.