Sha256: 78c6652b4ab2c63a486fc069d5483772b270e9ebb4a9911517d822a2aee99987

Contents?: true

Size: 800 Bytes

Versions: 9

Compression:

Stored size: 800 Bytes

Contents

require "logstash/inputs/base"
require "logstash/namespace"
require "logstash/stomp/handler"

class LogStash::Inputs::Stomp < LogStash::Inputs::Base
  public
  def initialize(url, config={}, &block)
    super
    @logger.debug(["Connecting", { :url => @url }])
  end # def initialize

  public
  def register
    @logger.info(["Registering input", { :url => @url}])
    EventMachine::connect(@url.host, @url.port, InputHandler, self, @logger, @url)
  end # def register

  private
  class InputHandler < LogStash::Stomp::Handler
    def receive_msg(message)
      super

      unless message.command == "CONNECTED"
        event = LogStash::Event.from_json(message.body)
        @input.receive(event)
      end
    end # def receive_msg
  end # class StompHandler
end # class LogStash::Inputs::Stomp

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
logstash-lite-0.2.20110505142231 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110422152244 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110405105201 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110331121236 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110329105411 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110206003603 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110203130400 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110122143801 lib/logstash/inputs/stomp.rb
logstash-lite-0.2.20110112115019 lib/logstash/inputs/stomp.rb