initial version of the consumer
added validations, separated the connection manager from the producer, added reconnection handling