def send_message(message, exchange_name = EventHub::EH_X_INBOUND)

      if @channel_sender.nil? || !@channel_sender.open?
        @channel_sender = AMQP::Channel.new(@connection, prefetch: 1)

        # use publisher confirm
        @channel_sender.confirm_select

        # @channel.on_error { |ch, channel_close| EventHub.logger.error "Oops! a channel-level exception: #{channel_close.reply_text}" }
        # @channel.on_ack   { |basic_ack| EventHub.logger.info "Received basic_ack: multiple = #{basic_ack.multiple}, delivery_tag = #{basic_ack.delivery_tag}" }
      end

      exchange = @channel_sender.direct(exchange_name, :durable => true, :auto_delete => false)
      exchange.publish(message.to_json, :persistent => true)
    end
def send_message(message, exchange_name = EventHub::EH_X_INBOUND)

      if @channel_sender.nil? || !@channel_sender.open?
        @channel_sender = AMQP::Channel.new(@connection, prefetch: 1)

        # use publisher confirm
        @channel_sender.confirm_select

        # @channel.on_error { |ch, channel_close| EventHub.logger.error "Oops! a channel-level exception: #{channel_close.reply_text}" }
        # @channel.on_ack   { |basic_ack| EventHub.logger.info "Received basic_ack: multiple = #{basic_ack.multiple}, delivery_tag = #{basic_ack.delivery_tag}" }
      end

      exchange = @channel_sender.direct(exchange_name, :durable => true, :auto_delete => false)
      exchange.publish(message.to_json, :persistent => true)
    end
send message