Sha256: a95a9aed4115188cd4fb55ae35f1367086f7f4b9f109dea0b64db9c7f7596e42

Contents?: true

Size: 742 Bytes

Versions: 24

Compression:

Stored size: 742 Bytes

Contents

# frozen_string_literal: true

module Phobos
  module Test
    module Helper
      TOPIC = 'test-topic'
      GROUP = 'test-group'

      def process_message(handler:, payload:, metadata: {}, force_encoding: nil)
        listener = Phobos::Listener.new(
          handler: handler,
          group_id: GROUP,
          topic: TOPIC, force_encoding: force_encoding
        )

        message = Kafka::FetchedMessage.new(
          message: Kafka::Protocol::Message.new(value: payload, key: nil, offset: 13),
          topic: TOPIC, partition: 0
        )

        Phobos::Actions::ProcessMessage.new(
          listener: listener,
          message: message,
          listener_metadata: metadata
        ).execute
      end
    end
  end
end

Version data entries

24 entries across 24 versions & 2 rubygems

Version Path
phobos-1.8.2 lib/phobos/test/helper.rb
phobos-1.8.2.pre.beta2 lib/phobos/test/helper.rb
phobos-1.8.2.pre.beta1 lib/phobos/test/helper.rb
phobos-1.8.1 lib/phobos/test/helper.rb