No release in over a year
Add this to your hutch config to try to reconnect whenever there is an error with ActiveRecord
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 1.1
 Project Readme

What it does

It provides a handler that will attempt to reconnect the Active Record with the database.

Whenever the database is reset while the hutch process is alive, the connection is not re-established like in a Rails application, so add this a handler to your hutch configuration.

Messages that get the error will still be nacked by hutch, you will need to add code to your application to requeue your messsages if you want.

Configuring

On your hutch initializer

require 'hutch/error_handlers/reconnect_active_record'

Hutch::Config.set(:error_handlers, [
  Hutch::ErrorHandlers::Logger.new, Hutch::ErrorHandlers::ReconnectActiveRecord.new
])

or if you just want to add the handler after some other configurations

require 'hutch/error_handlers/reconnect_active_record'

Hutch::Config[:error_handlers] << Hutch::ErrorHandlers::ReconnectActiveRecord.new