class Fluent::Plugin::PulsarOutput

Public Instance Methods

configure(conf) click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_pulsar.rb, line 26
def configure(conf)
  super
end
proces(tag,es) click to toggle source
# File lib/fluent/plugin/out_pulsar.rb, line 51
def proces(tag,es)
    es.each do |time, record|
      log.debug "Publishing records to #{@pulsar_topic}"
      @producer.send(@pulsar_topic,@pulsar_producer,@num_messages,record)
      log.debug "Successfully sent a record to #{@pulsar_topic}"
  end
end
refresh_brokers(raise_error = true) click to toggle source
# File lib/fluent/plugin/out_pulsar.rb, line 30
def refresh_brokers(raise_error = true)
  begin
    if @pulsar_host != nil && @pulsar_port != nil
      @producer = Message::PulsarClient.new()
      @producer.connect(@pulsar_host, @pulsar_port)
      log.info "Connected to pulsar brokers successfully"
    end
  rescue Exception => e
    if raise_error
      raise e
    else
      log.error e
    end
  end
end
start() click to toggle source
Calls superclass method
# File lib/fluent/plugin/out_pulsar.rb, line 46
def start
  super
  refresh_brokers
end