Sha256: 2e0ac8849bb8f80945603a54e413cea75cc916e984cd850f7b33f900dfa983be

Contents?: true

Size: 993 Bytes

Versions: 2

Compression:

Stored size: 993 Bytes

Contents

require 'rabbit_feed'
require_relative 'non_rails_app/event_handler'

RabbitFeed.log = Logger.new('log/rabbit_feed.log')
RabbitFeed.log.formatter = RabbitFeed::JsonLogFormatter

EventRouting do
  accept_from('rails_app') do
    event('user_creates_beaver') do |event|
      NonRailsApp::EventHandler.handle_event event
    end
    event('user_updates_beaver') do |event|
      NonRailsApp::EventHandler.handle_event event
    end
    event('user_deletes_beaver') do |event|
      NonRailsApp::EventHandler.handle_event event
    end
  end
  accept_from('non_rails_app') do
    event('test_event') do |event|
    end
  end
end

EventDefinitions do
  define_event('application_acknowledges_event', version: '1.0.0') do
    defined_as do
      'An event has been acknowledged'
    end
    payload_contains do
      field('beaver_name', type: 'string', definition: 'The name of the beaver')
      field('event_name', type: 'string', definition: 'The name of the original event')
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
rabbit_feed-2.3.1 example/non_rails_app/lib/non_rails_app.rb
rabbit_feed-2.3.0 example/non_rails_app/lib/non_rails_app.rb