Sha256: 245ad59998e50fd10ff94f76423bda91da9936656c9a9d4595a9ab57f09c0723

Contents?: true

Size: 674 Bytes

Versions: 2

Compression:

Stored size: 674 Bytes

Contents

module LogStash
  module Outputs
    module Pubsub
      # Implements ApiFutureCallback<String>
      class MessageFutureCallback
        def initialize(message_body, logger)
          @message_body = message_body
          @logger = logger
        end

        # Implements public void onSuccess(String messageId)
        def on_success(message_id)
          @logger.debug("Published #{@message_body} with id: #{message_id}")
        end

        # Implements public void onFailure(Throwable t)
        def on_failure(throwable)
          @logger.error("Failed to send message.", message: @message_body, error: throwable.getMessage)
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
logstash-output-google_pubsub-1.0.1-java lib/logstash/outputs/pubsub/message_future_callback.rb
logstash-output-google_pubsub-1.0.0-java lib/logstash/outputs/pubsub/message_future_callback.rb