Class: LogStash::Inputs::Stomp

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

Constant Summary

Constants included from Config::Mixin

Config::Mixin::CONFIGSORT

Instance Attribute Summary

Attributes inherited from Base

#params, #threadable

Attributes included from Config::Mixin

#config, #original_params

Attributes inherited from Plugin

#logger, #params

Instance Method Summary collapse

Methods inherited from Base

#initialize, #tag

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::Inputs::Base

Instance Method Details

#registerObject



48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/logstash/inputs/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
  @stomp_url = "stomp://#{@user}:#{@password}@#{@host}:#{@port}/#{@destination}"

  # Handle disconnects 
  @client.on_connection_closed {
    connect
    subscription_handler # is required for re-subscribing to the destination
  }
  connect
end

#run(output_queue) ⇒ Object



80
81
82
83
# File 'lib/logstash/inputs/stomp.rb', line 80

def run(output_queue)
  @output_queue = output_queue 
  subscription_handler
end