Class: LogStash::Inputs::Stomp
- Inherits:
-
Base
- Object
- Base
- LogStash::Inputs::Stomp
- Defined in:
- lib/logstash/inputs/stomp.rb
Overview
Creates events received with the STOMP protocol.
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
Instance Method Summary collapse
-
#new_client ⇒ Object
def register.
- #register ⇒ Object
- #run(output_queue) ⇒ Object
-
#stop ⇒ Object
def run.
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
8 9 10 |
# File 'lib/logstash/inputs/stomp.rb', line 8 def client @client end |
Instance Method Details
#new_client ⇒ Object
def register
70 71 72 |
# File 'lib/logstash/inputs/stomp.rb', line 70 def new_client OnStomp::Client.new("stomp://#{@host}:#{@port}", :login => @user, :passcode => @password.value) end |
#register ⇒ Object
62 63 64 65 66 67 68 |
# File 'lib/logstash/inputs/stomp.rb', line 62 def register require "onstomp" @client = new_client @client.host = @vhost if @vhost @stomp_url = "stomp://#{@user}:#{@password}@#{@host}:#{@port}/#{@destination}" end |
#run(output_queue) ⇒ Object
97 98 99 100 101 102 103 104 105 106 107 |
# File 'lib/logstash/inputs/stomp.rb', line 97 def run(output_queue) # Handle disconnects @client.on_connection_closed { self.connect subscription_handler # is required for re-subscribing to the destination } connect @output_queue = output_queue subscription_handler end |
#stop ⇒ Object
def run
109 110 111 |
# File 'lib/logstash/inputs/stomp.rb', line 109 def stop @client.disconnect if @client && @client.connected? end |