refactoring jms and amqp