Class: LogStash::Outputs::Stomp

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

Instance Attribute Summary collapse

Attributes inherited from Base

#logger

Instance Method Summary collapse

Constructor Details

#initialize(url, config = {}, &block) ⇒ Stomp

Returns a new instance of Stomp.



9
10
11
12
13
# File 'lib/logstash/outputs/stomp.rb', line 9

def initialize(url, config={}, &block)
  super

  @logger.debug(["Initialize", { :url => @url }])
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



6
7
8
# File 'lib/logstash/outputs/stomp.rb', line 6

def url
  @url
end

Instance Method Details

#receive(event) ⇒ Object



22
23
24
25
# File 'lib/logstash/outputs/stomp.rb', line 22

def receive(event)
  @logger.debug(["Sending event", { :url => @url, :event => event }])
  @connection.send(@url.path, event.to_json)
end

#registerObject



16
17
18
19
# File 'lib/logstash/outputs/stomp.rb', line 16

def register
  @logger.info(["Registering output", { :url => @url }])
  @connection = EventMachine::connect(@url.host, @url.port, LogStash::Stomp::Handler, self, @logger, @url)
end