Ho un server rabbitmq e un utente amqp (python) che utilizza kombu.
Ho installato la mia app in un sistema con un firewall che chiude le connessioni inattive dopo 1 ora.
Questo è il mio amqp_consumer.py:RabbitMQ heartbeat vs timeout connessione drain time
try:
# connections
with Connection(self.broker_url, ssl=_ssl, heartbeat=self.heartbeat) as conn:
chan = conn.channel()
# more stuff here
with conn.Consumer(queue, callbacks = [messageHandler], channel = chan):
# Process messages and handle events on all channels
while True:
conn.drain_events()
except Exception as e:
# do stuff
quello che voglio è che se il firewall ha chiuso la connessione, quindi voglio ricollegare. dovrei usare l'argomento heartbeat o dovrei passare un argomento timeout (di 3600 sec) alla funzione drain_events()
?
Quali sono le differenze tra le due opzioni? (sembra fare lo stesso).
Grazie.