class MCollective::Connector::Rabbitmq::EventLogger - mcollective version 2.12.5

# class MCollective::Connector::Rabbitmq::EventLogger

### Public Instance Methods

on_connected(params=nil) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    14 def on_connected(params=nil)
    15   Log.info("Connected to #{stomp_url(params)}")
    16 rescue
    17 end

on_connectfail(params=nil) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    24 def on_connectfail(params=nil)
    25   Log.info("TCP Connection to #{stomp_url(params)} failed on attempt #{params[:cur_conattempts]}")
    26 rescue
    27 end

on_connecting(params=nil) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
     9 def on_connecting(params=nil)
    10   Log.info("TCP Connection attempt %d to %s" % [params[:cur_conattempts], stomp_url(params)])
    11 rescue
    12 end

on_disconnect(params=nil) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    19 def on_disconnect(params=nil)
    20   Log.info("Disconnected from #{stomp_url(params)}")
    21 rescue
    22 end

on_hbfire(params, srind, curt) click to toggle source

`Log` heart beat fires

       # File lib/mcollective/connector/rabbitmq.rb
    81 def on_hbfire(params, srind, curt)
    82   case srind
    83     when "receive_fire"
    84       Log.debug("Received heartbeat from %s: %s, %s" % [stomp_url(params), srind, curt])
    85     when "send_fire"
    86       Log.debug("Publishing heartbeat to %s: %s, %s" % [stomp_url(params), srind, curt])
    87   end
    88 rescue Exception => e
    89 end

on_hbread_fail(params, ticker_data) click to toggle source

Stomp 1.1+ - heart beat read (receive) failed.

       # File lib/mcollective/connector/rabbitmq.rb
    49 def on_hbread_fail(params, ticker_data)
    50   if ticker_data["lock_fail"]
    51     if params[:max_hbrlck_fails] == 0
    52       # failure is disabled
    53       Log.debug("Heartbeat failed to acquire readlock for '%s': %s" % [stomp_url(params), ticker_data.inspect])
    54     elsif ticker_data['lock_fail_count'] >= params[:max_hbrlck_fails]
    55       # we're about to force a disconnect
    56       Log.error("Heartbeat failed to acquire readlock for '%s': %s" % [stomp_url(params), ticker_data.inspect])
    57     else
    58       Log.warn("Heartbeat failed to acquire readlock for '%s': %s" % [stomp_url(params), ticker_data.inspect])
    59     end
    60   else
    61     if params[:max_hbread_fails] == 0
    62       # failure is disabled
    63       Log.debug("Heartbeat read failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
    64     elsif ticker_data['read_fail_count'] >= params[:max_hbread_fails]
    65       # we're about to force a reconnect
    66       Log.error("Heartbeat read failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
    67     else
    68       Log.warn("Heartbeat read failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
    69     end
    70   end
    71 rescue Exception => e
    72 end

on_hbwrite_fail(params, ticker_data) click to toggle source

Stomp 1.1+ - heart beat send (transmit) failed.

       # File lib/mcollective/connector/rabbitmq.rb
    75 def on_hbwrite_fail(params, ticker_data)
    76   Log.error("Heartbeat write failed from '%s': %s" % [stomp_url(params), ticker_data.inspect])
    77 rescue Exception => e
    78 end

on_miscerr(params, errstr) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    29 def on_miscerr(params, errstr)
    30   Log.error("Unexpected error on connection #{stomp_url(params)}: #{errstr}")
    31 rescue
    32 end

on_ssl_connected(params) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    39 def on_ssl_connected(params)
    40   Log.info("SSL session established with #{stomp_url(params)}")
    41 rescue
    42 end

on_ssl_connectfail(params) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    44 def on_ssl_connectfail(params)
    45   Log.error("SSL session creation with #{stomp_url(params)} failed: #{params[:ssl_exception]}")
    46 end

on_ssl_connecting(params) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    34 def on_ssl_connecting(params)
    35   Log.info("Establishing SSL session with #{stomp_url(params)}")
    36 rescue
    37 end

stomp_url(params) click to toggle source

       # File lib/mcollective/connector/rabbitmq.rb
    91 def stomp_url(params)
    92   "%s://%s@%s:%d" % [ params[:cur_ssl] ? "stomp+ssl" : "stomp", params[:cur_login], params[:cur_host], params[:cur_port]]
    93 end