Class: LogStash::Outputs::Stomp

Inherits:
Base show all
Defined in:
lib/logstash/outputs/stomp.rb

Constant Summary

Constants included from Config::Mixin

Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes included from Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods inherited from Base

#handle, #handle_worker, #initialize, #worker_setup, #workers_not_supported

Methods included from Config::Mixin

#config_init, included

Methods inherited from Plugin

#eql?, #finished, #finished?, #hash, #initialize, #inspect, lookup, #reload, #running?, #shutdown, #teardown, #terminating?, #to_s

Constructor Details

This class inherits a constructor from LogStash::Outputs::Base

Instance Method Details

#receive(event) ⇒ Object

def register



61
62
63
64
65
66
# File 'lib/logstash/outputs/stomp.rb', line 61

def receive(event)
    return unless output?(event)

    @logger.debug(["stomp sending event", { :host => @host, :event => event }])
    @client.send(event.sprintf(@destination), event.to_json)
end

#registerObject



48
49
50
51
52
53
54
55
56
57
58
59
# File 'lib/logstash/outputs/stomp.rb', line 48

def register
  require "onstomp"
  @client = OnStomp::Client.new("stomp://#{@host}:#{@port}", :login => @user, :passcode => @password.value)
  @client.host = @vhost if @vhost

  # Handle disconnects
  @client.on_connection_closed {
    connect
  }
  
  connect
end