Class: LogStash::Outputs::Stomp
- Defined in:
- lib/logstash/outputs/stomp.rb
Constant Summary
Constants included from Config::Mixin
Instance Attribute Summary
Attributes included from Config::Mixin
Attributes inherited from Plugin
Instance Method Summary collapse
-
#receive(event) ⇒ Object
def register.
- #register ⇒ Object
Methods inherited from Base
#handle, #handle_worker, #initialize, #worker_setup, #workers_not_supported
Methods included from Config::Mixin
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 |
#register ⇒ Object
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 |