copy of PR #247 to fix rabbitmq 3.4 upgrade