ruby-amqp / hutch

A system for processing messages from RabbitMQ.
https://gocardless.com/blog/hutch-inter-service-communication-with-rabbitmq/
MIT License
855 stars 137 forks source link

handle type-casting for config, even when explicitly setting values using .set method #358

Closed Azdaroth closed 3 years ago

Azdaroth commented 3 years ago

I had a pretty unfortunate issue when directly setting the config value for heartbeat without an explicit typecasting: Hutch::Config.set(:heartbeat, ENV.fetch("HUTCH_HEARTBEAT", 30)) but the ENV var was obviously a string and it caused some failures when publishing messages. Since the type is explicitly declared on a config level, I believe the desired behaviour would be to handle type-casting inside set method as well.

Azdaroth commented 3 years ago

Hey, any news regarding this PR? Does it look like the desired behavior?

michaelklishin commented 3 years ago

This looks reasonable, I need to take a look at the test failure.