mirror of
https://github.com/elastic/logstash.git
synced 2025-04-24 22:57:16 -04:00
Merge pull request #490 from bodgit/stomp
Enhance stomp input/output with an optional vhost param.
This commit is contained in:
commit
8843778132
2 changed files with 9 additions and 1 deletions
|
@ -23,6 +23,9 @@ class LogStash::Inputs::Stomp < LogStash::Inputs::Base
|
|||
# Example: "/topic/logstash"
|
||||
config :destination, :validate => :string, :required => true
|
||||
|
||||
# The vhost to use
|
||||
config :vhost, :validate => :string, :default => nil
|
||||
|
||||
# Enable debugging output?
|
||||
config :debug, :validate => :boolean, :default => false
|
||||
|
||||
|
@ -42,8 +45,9 @@ class LogStash::Inputs::Stomp < LogStash::Inputs::Base
|
|||
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
|
||||
|
|
|
@ -23,6 +23,9 @@ class LogStash::Outputs::Stomp < LogStash::Outputs::Base
|
|||
# Example: "/topic/logstash"
|
||||
config :destination, :validate => :string, :required => true
|
||||
|
||||
# The vhost to use
|
||||
config :vhost, :validate => :string, :default => nil
|
||||
|
||||
# Enable debugging output?
|
||||
config :debug, :validate => :boolean, :default => false
|
||||
|
||||
|
@ -44,6 +47,7 @@ class LogStash::Outputs::Stomp < LogStash::Outputs::Base
|
|||
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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue