messaging 0.0.2 → 3.4.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +68 -0
  3. data/.gitignore +11 -0
  4. data/.rspec +2 -0
  5. data/.ruby-version +1 -0
  6. data/Gemfile +15 -0
  7. data/Gemfile.lock +222 -0
  8. data/README.md +53 -0
  9. data/Rakefile +5 -30
  10. data/_config.yml +1 -0
  11. data/bin/console +11 -0
  12. data/bin/setup +8 -0
  13. data/exe/messaging +11 -0
  14. data/lib/messaging.rb +62 -11
  15. data/lib/messaging/adapters.rb +35 -0
  16. data/lib/messaging/adapters/kafka.rb +55 -0
  17. data/lib/messaging/adapters/kafka/consumer.rb +101 -0
  18. data/lib/messaging/adapters/kafka/producer.rb +52 -0
  19. data/lib/messaging/adapters/postgres.rb +23 -0
  20. data/lib/messaging/adapters/postgres/advisory_transaction_lock.rb +28 -0
  21. data/lib/messaging/adapters/postgres/serialized_message.rb +74 -0
  22. data/lib/messaging/adapters/postgres/store.rb +66 -0
  23. data/lib/messaging/adapters/postgres/stream.rb +37 -0
  24. data/lib/messaging/adapters/postgres/streams.rb +27 -0
  25. data/lib/messaging/adapters/test.rb +59 -0
  26. data/lib/messaging/adapters/test/consumer.rb +46 -0
  27. data/lib/messaging/adapters/test/store.rb +67 -0
  28. data/lib/messaging/adapters/test/stream.rb +21 -0
  29. data/lib/messaging/base_handler.rb +45 -0
  30. data/lib/messaging/cli.rb +62 -0
  31. data/lib/messaging/config.rb +66 -0
  32. data/lib/messaging/consumer_supervisor.rb +63 -0
  33. data/lib/messaging/exception_handler.rb +15 -0
  34. data/lib/messaging/expected_version.rb +31 -0
  35. data/lib/messaging/instrumentation.rb +21 -0
  36. data/lib/messaging/message.rb +103 -0
  37. data/lib/messaging/message/from_json.rb +31 -0
  38. data/lib/messaging/meter.rb +113 -0
  39. data/lib/messaging/middleware.rb +14 -0
  40. data/lib/messaging/middleware/after_active_record_transaction.rb +13 -0
  41. data/lib/messaging/middleware/rails_wrapper.rb +22 -0
  42. data/lib/messaging/publish.rb +33 -0
  43. data/lib/messaging/rails/railtie.rb +36 -0
  44. data/lib/messaging/resque_worker.rb +11 -0
  45. data/lib/messaging/routes.rb +50 -0
  46. data/lib/messaging/routing.rb +67 -0
  47. data/lib/messaging/routing/background_job_subscriber.rb +11 -0
  48. data/lib/messaging/routing/enqueue_message_handler.rb +15 -0
  49. data/lib/messaging/routing/message_matcher.rb +62 -0
  50. data/lib/messaging/routing/subscriber.rb +35 -0
  51. data/lib/messaging/sidekiq_worker.rb +12 -0
  52. data/lib/messaging/version.rb +1 -1
  53. data/messaging.gemspec +40 -0
  54. metadata +299 -102
  55. data/MIT-LICENSE +0 -20
  56. data/app/models/message.rb +0 -5
  57. data/app/models/receipt.rb +0 -13
  58. data/app/uploaders/attachment_uploader.rb +0 -9
  59. data/db/migrate/20130801214110_initial_migration.rb +0 -22
  60. data/lib/generators/messaging/install_generator.rb +0 -26
  61. data/lib/generators/messaging/templates/initializer.rb +0 -11
  62. data/lib/messaging/concerns/configurable_mailer.rb +0 -13
  63. data/lib/messaging/engine.rb +0 -9
  64. data/lib/messaging/models/messageable.rb +0 -24
  65. data/lib/tasks/messaging_tasks.rake +0 -4
  66. data/test/dummy/README.rdoc +0 -28
  67. data/test/dummy/Rakefile +0 -6
  68. data/test/dummy/app/assets/javascripts/application.js +0 -13
  69. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  70. data/test/dummy/app/controllers/application_controller.rb +0 -5
  71. data/test/dummy/app/helpers/application_helper.rb +0 -2
  72. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  73. data/test/dummy/bin/bundle +0 -3
  74. data/test/dummy/bin/rails +0 -4
  75. data/test/dummy/bin/rake +0 -4
  76. data/test/dummy/config.ru +0 -4
  77. data/test/dummy/config/application.rb +0 -23
  78. data/test/dummy/config/boot.rb +0 -5
  79. data/test/dummy/config/database.yml +0 -25
  80. data/test/dummy/config/environment.rb +0 -5
  81. data/test/dummy/config/environments/development.rb +0 -29
  82. data/test/dummy/config/environments/production.rb +0 -80
  83. data/test/dummy/config/environments/test.rb +0 -36
  84. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  85. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  86. data/test/dummy/config/initializers/inflections.rb +0 -16
  87. data/test/dummy/config/initializers/mime_types.rb +0 -5
  88. data/test/dummy/config/initializers/secret_token.rb +0 -12
  89. data/test/dummy/config/initializers/session_store.rb +0 -3
  90. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  91. data/test/dummy/config/locales/en.yml +0 -23
  92. data/test/dummy/config/routes.rb +0 -56
  93. data/test/dummy/public/404.html +0 -58
  94. data/test/dummy/public/422.html +0 -58
  95. data/test/dummy/public/500.html +0 -57
  96. data/test/dummy/public/favicon.ico +0 -0
  97. data/test/messaging_test.rb +0 -7
  98. data/test/test_helper.rb +0 -15
@@ -0,0 +1,36 @@
1
+ require 'rails/railtie'
2
+ require 'messaging/middleware/after_active_record_transaction'
3
+ require 'messaging/middleware/rails_wrapper'
4
+
5
+ module Messaging
6
+ module Rails
7
+ class Railtie < ::Rails::Railtie
8
+ config.after_initialize do
9
+ # Add the wrapper before any middlewares that may have been added by the initializer
10
+ # in the Rails app.
11
+ Messaging.config.consumer.middlewares.prepend(Middleware::RailsWrapper.new(::Rails.application))
12
+
13
+ # Run dispatchers after the current transaction has commited
14
+ Messaging.config.dispatcher.middlewares.prepend(Middleware::AfterActiveRecordTransaction)
15
+
16
+ # Eager load handlers for development mode to define consumers.
17
+ # This is needed as long as we use old style handlers that uses "listen_on"
18
+ # When we only use routing we don't need to eager load.
19
+ #
20
+ # Uses require_dependency as normal eager_load with Rails breaks code reloading.
21
+ next unless ::Rails.env.development?
22
+
23
+ Dir.glob("#{::Rails.root}/app/models/*.rb").each { |h| require_dependency h }
24
+ Dir.glob("#{::Rails.root}/{app,lib}/**/handlers/**/*.rb").each { |h| require_dependency h }
25
+ end
26
+
27
+ # As the consumer has a reference to the handler we need to clear that after
28
+ # the class has been unloaded and update the consumer with the reloaded classes.
29
+ initializer 'messaging.add_reloader' do |app|
30
+ app.reloader.after_class_unload do
31
+ Messaging.routes.reload_consumer_subscriptions!
32
+ end
33
+ end
34
+ end
35
+ end
36
+ end
@@ -0,0 +1,11 @@
1
+ module Messaging
2
+ class ResqueWorker
3
+ @queue = :messaging
4
+
5
+ def self.perform(raw_message, handler_name)
6
+ message = Messaging::Message::FromJson.(raw_message)
7
+ handler = handler_name.constantize
8
+ handler.call message
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,50 @@
1
+ module Messaging
2
+ # Public: Used by Messaging.routes to setup the routes for matching messages to callables
3
+ #
4
+ # See routing.rb for more information.
5
+ class Routes
6
+ include Routing
7
+
8
+ # Creates a consumer for the default adapter
9
+ #
10
+ # @param name [Symbol] the name of the consumer.
11
+ def consumer(name, **options, &block)
12
+ consumer_definitions[name] = { options: options, block: block }
13
+ end
14
+
15
+ def define_consumers!
16
+ return unless consumers.empty?
17
+
18
+ consumer_definitions.each do |name, definition|
19
+ c = Messaging.consumer_adapter.create_consumer(name, definition.fetch(:options))
20
+ definition.fetch(:block)&.call(c)
21
+ consumers << c
22
+ end
23
+ end
24
+
25
+ # Keeps the consumers, but reload their subscriptions so code reloading works.
26
+ # The consumer has a reference to the class name of each of its handlers,
27
+ # if the handler is reloaded the reference would point to an old instance.
28
+ def reload_consumer_subscriptions!
29
+ consumers.each do |c|
30
+ c.clear_subscribers!
31
+ consumer_definitions[c.name].fetch(:block)&.call(c)
32
+ end
33
+ end
34
+
35
+ def consumers
36
+ @consumers ||= []
37
+ end
38
+
39
+ # Public: Evaluate route definition.
40
+ def draw(&block)
41
+ instance_eval(&block)
42
+ end
43
+
44
+ private
45
+
46
+ def consumer_definitions
47
+ @consumer_definitions ||= {}
48
+ end
49
+ end
50
+ end
@@ -0,0 +1,67 @@
1
+ require 'messaging/routing/message_matcher'
2
+ require 'messaging/routing/subscriber'
3
+ require 'messaging/routing/background_job_subscriber'
4
+ require 'messaging/routing/enqueue_message_handler'
5
+
6
+ module Messaging
7
+ module Routing
8
+ # Public: Sets up subscribers for the events that matches the given pattern
9
+ #
10
+ # pattern - Which messages to subscribe to. Can be a string, a regexp,
11
+ # a Message class, a module or anything that responds to call.
12
+ #
13
+ # call: - Any object that responds to call.
14
+ # Will be called immediately for matching messages.
15
+ #
16
+ # enqueue: - A constant that responds to call.
17
+ # Will be enqueued with Sidekiq for matching messages.
18
+ # Needs to be a constant that Sidekiq can serialize to a string
19
+ # and back again to a constant as you can't store procs in Redis.
20
+ #
21
+ # block - An optional block that will be called with each matching message.
22
+ #
23
+ #
24
+ # Examples
25
+ #
26
+ # Messaging.routes.draw do
27
+ # on 'Events::BidPlaced', call: NotifyOtherBidders
28
+ #
29
+ # on Events::BidPlaced, enqueue: NotifyOtherBidders
30
+ #
31
+ # on Events, do |event|
32
+ # puts event.inspect
33
+ # end
34
+ #
35
+ # on /.*Updated$/, enqueue: AuditChanges
36
+ #
37
+ # on ->(m) { m.topic == 'my-topic' }, call: DoSometing, enqueue: DoSomethingElseWithSidekiq
38
+ # end
39
+ #
40
+ def on(pattern = /.*/, topic: nil, call: nil, enqueue: nil, &block)
41
+ subscribers << Subscriber.new(pattern, topic, call) if call
42
+ subscribers << Subscriber.new(pattern, topic, block) if block_given?
43
+ subscribers << BackgroundJobSubscriber.new(pattern, topic, enqueue) if enqueue
44
+ end
45
+
46
+ # Internal: Handles the message with the matching subscribers
47
+ def handle(message)
48
+ subscribers.map { |subscriber| subscriber.call(message) }
49
+ message
50
+ end
51
+
52
+ # Internal: Used by Rails reloading in development.
53
+ def clear_subscribers!
54
+ @subscribers = Set.new
55
+ end
56
+
57
+ private
58
+
59
+ def subscribers
60
+ @subscribers ||= Set.new
61
+ end
62
+
63
+ def topics
64
+ subscribers.flat_map(&:topics).map(&:to_s).uniq
65
+ end
66
+ end
67
+ end
@@ -0,0 +1,11 @@
1
+ module Messaging
2
+ module Routing
3
+ # Internal: Used for enqueing background jobs instead of calling the handler directly
4
+ class BackgroundJobSubscriber < Subscriber
5
+ def initialize(pattern, topic, handler)
6
+ super
7
+ @handler = EnqueueMessageHandler.new(handler)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,15 @@
1
+ module Messaging
2
+ module Routing
3
+ class EnqueueMessageHandler
4
+ attr_reader :handler
5
+
6
+ def initialize(handler)
7
+ @handler = handler
8
+ end
9
+
10
+ def call(message)
11
+ Config.background_job_handler.call(message, handler)
12
+ end
13
+ end
14
+ end
15
+ end
@@ -0,0 +1,62 @@
1
+ require 'dry-equalizer'
2
+ module Messaging
3
+ module Routing
4
+ # Internal: Used by subscribers to match messages.
5
+ class MessageMatcher
6
+ include Dry::Equalizer(:pattern, :topic_pattern)
7
+
8
+ attr_accessor :pattern
9
+ attr_accessor :topic_pattern
10
+
11
+ def initialize(pattern:, topic: nil)
12
+ self.pattern = pattern
13
+ self.topic_pattern = topic
14
+ end
15
+
16
+ # Internal: See routing.rb for examples on how it is used.
17
+
18
+ # Med case statement
19
+ def matches?(message)
20
+ matches_topic?(message) && matches_pattern?(message)
21
+ end
22
+
23
+ def matches_pattern?(message)
24
+ case pattern
25
+ when Regexp
26
+ pattern =~ message.message_type
27
+ when Class, Module
28
+ /^#{pattern}/ =~ message.message_type
29
+ when Proc
30
+ pattern.call(message)
31
+ else
32
+ false
33
+ end
34
+ end
35
+
36
+ def matches_topic?(message)
37
+ return true unless topic_pattern
38
+
39
+ case message.topic.to_s
40
+ when topic_pattern then true
41
+ else
42
+ false
43
+ end
44
+ end
45
+
46
+ def call(message)
47
+ matches?(message)
48
+ end
49
+
50
+ def all_matching_messages
51
+ Messaging.defined_messages.select(&method(:matches?))
52
+ end
53
+
54
+ # Internal: Get all topics that the matcher would need to match a message.
55
+ #
56
+ # Used by the Kafka adapter to setup consumers.
57
+ def topics
58
+ (Array(topic_pattern) + all_matching_messages.map(&:topic)).uniq
59
+ end
60
+ end
61
+ end
62
+ end
@@ -0,0 +1,35 @@
1
+ require 'dry-equalizer'
2
+
3
+ module Messaging
4
+ module Routing
5
+ # Internal: Used by routing to match a pattern against a callable (handler)
6
+ class Subscriber
7
+ include Dry::Equalizer(:matcher, :handler)
8
+
9
+ attr_reader :matcher
10
+ attr_reader :handler
11
+
12
+ def initialize(pattern, topic, handler)
13
+ @matcher = MessageMatcher.new(pattern: pattern, topic: topic)
14
+ @handler = handler
15
+ verify_handler!
16
+ end
17
+
18
+ def call(message)
19
+ return unless @matcher.matches?(message)
20
+
21
+ @handler.call(message)
22
+ end
23
+
24
+ def topics
25
+ matcher.topics
26
+ end
27
+
28
+ private
29
+
30
+ def verify_handler!
31
+ raise ArgumentError, 'Handler must be callable' unless handler.respond_to? :call
32
+ end
33
+ end
34
+ end
35
+ end
@@ -0,0 +1,12 @@
1
+ module Messaging
2
+ class SidekiqWorker
3
+ include Sidekiq::Worker
4
+ sidekiq_options queue: 'messaging'
5
+
6
+ def perform(raw_message, handler_name)
7
+ message = Messaging::Message::FromJson.(raw_message)
8
+ handler = handler_name.constantize
9
+ handler.call message
10
+ end
11
+ end
12
+ end
@@ -1,3 +1,3 @@
1
1
  module Messaging
2
- VERSION = "0.0.2"
2
+ VERSION = '3.4.1'.freeze
3
3
  end
data/messaging.gemspec ADDED
@@ -0,0 +1,40 @@
1
+ lib = File.expand_path('lib', __dir__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'messaging/version'
4
+
5
+ Gem::Specification.new do |spec|
6
+ spec.name = "messaging"
7
+ spec.version = Messaging::VERSION
8
+ spec.authors = ["Bukowskis"]
9
+ spec.email = ["developers@bukowskis.com"]
10
+ spec.summary = %q( A library for decoupling applications by using messaging to communicate between components. )
11
+ spec.homepage = "https://bukowskis.github.io/messaging/"
12
+
13
+ spec.files = `git ls-files -z`.split("\x0").reject do |f|
14
+ f.match(%r{^(test|spec|features)/})
15
+ end
16
+
17
+ spec.bindir = 'exe'
18
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
+ spec.require_paths = ['lib']
20
+
21
+ spec.add_dependency 'activerecord'
22
+ spec.add_dependency 'activesupport'
23
+ spec.add_dependency 'bukowskis_after_transaction'
24
+ spec.add_dependency 'method_object'
25
+ spec.add_dependency 'concurrent-ruby', '>= 1.0.2'
26
+ spec.add_dependency 'concurrent-ruby-ext', '>= 1.0.2'
27
+ spec.add_dependency 'dry-configurable'
28
+ spec.add_dependency 'dry-container'
29
+ spec.add_dependency 'dry-equalizer'
30
+ spec.add_dependency 'dry-initializer'
31
+ spec.add_dependency 'meter', '>= 1.2.1'
32
+ spec.add_dependency 'ruby-kafka', '>= 0.5.3'
33
+ spec.add_dependency 'virtus'
34
+
35
+ spec.add_development_dependency 'bundler', '~> 1.14'
36
+ spec.add_development_dependency 'rake', '~> 10.0'
37
+ spec.add_development_dependency 'rspec', '~> 3.0'
38
+ spec.add_development_dependency 'rspec-rails'
39
+ spec.add_development_dependency 'simplecov'
40
+ end
metadata CHANGED
@@ -1,100 +1,329 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: messaging
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 3.4.1
5
5
  platform: ruby
6
6
  authors:
7
- - Rocco Stanzione
7
+ - Bukowskis
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2013-08-04 00:00:00.000000000 Z
11
+ date: 2019-10-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: rails
14
+ name: activerecord
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 4.0.0
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: activesupport
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: bukowskis_after_transaction
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: method_object
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - ">="
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: concurrent-ruby
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: 1.0.2
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: 1.0.2
83
+ - !ruby/object:Gem::Dependency
84
+ name: concurrent-ruby-ext
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - ">="
88
+ - !ruby/object:Gem::Version
89
+ version: 1.0.2
90
+ type: :runtime
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - ">="
95
+ - !ruby/object:Gem::Version
96
+ version: 1.0.2
97
+ - !ruby/object:Gem::Dependency
98
+ name: dry-configurable
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :runtime
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
111
+ - !ruby/object:Gem::Dependency
112
+ name: dry-container
113
+ requirement: !ruby/object:Gem::Requirement
114
+ requirements:
115
+ - - ">="
116
+ - !ruby/object:Gem::Version
117
+ version: '0'
118
+ type: :runtime
119
+ prerelease: false
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: dry-equalizer
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - ">="
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: dry-initializer
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :runtime
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: meter
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: 1.2.1
20
160
  type: :runtime
21
161
  prerelease: false
22
162
  version_requirements: !ruby/object:Gem::Requirement
23
163
  requirements:
24
- - - ~>
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: 1.2.1
167
+ - !ruby/object:Gem::Dependency
168
+ name: ruby-kafka
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: 0.5.3
174
+ type: :runtime
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: 0.5.3
181
+ - !ruby/object:Gem::Dependency
182
+ name: virtus
183
+ requirement: !ruby/object:Gem::Requirement
184
+ requirements:
185
+ - - ">="
186
+ - !ruby/object:Gem::Version
187
+ version: '0'
188
+ type: :runtime
189
+ prerelease: false
190
+ version_requirements: !ruby/object:Gem::Requirement
191
+ requirements:
192
+ - - ">="
193
+ - !ruby/object:Gem::Version
194
+ version: '0'
195
+ - !ruby/object:Gem::Dependency
196
+ name: bundler
197
+ requirement: !ruby/object:Gem::Requirement
198
+ requirements:
199
+ - - "~>"
200
+ - !ruby/object:Gem::Version
201
+ version: '1.14'
202
+ type: :development
203
+ prerelease: false
204
+ version_requirements: !ruby/object:Gem::Requirement
205
+ requirements:
206
+ - - "~>"
207
+ - !ruby/object:Gem::Version
208
+ version: '1.14'
209
+ - !ruby/object:Gem::Dependency
210
+ name: rake
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - "~>"
214
+ - !ruby/object:Gem::Version
215
+ version: '10.0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - "~>"
221
+ - !ruby/object:Gem::Version
222
+ version: '10.0'
223
+ - !ruby/object:Gem::Dependency
224
+ name: rspec
225
+ requirement: !ruby/object:Gem::Requirement
226
+ requirements:
227
+ - - "~>"
228
+ - !ruby/object:Gem::Version
229
+ version: '3.0'
230
+ type: :development
231
+ prerelease: false
232
+ version_requirements: !ruby/object:Gem::Requirement
233
+ requirements:
234
+ - - "~>"
25
235
  - !ruby/object:Gem::Version
26
- version: 4.0.0
236
+ version: '3.0'
27
237
  - !ruby/object:Gem::Dependency
28
- name: sqlite3
238
+ name: rspec-rails
29
239
  requirement: !ruby/object:Gem::Requirement
30
240
  requirements:
31
- - - ! '>='
241
+ - - ">="
32
242
  - !ruby/object:Gem::Version
33
243
  version: '0'
34
244
  type: :development
35
245
  prerelease: false
36
246
  version_requirements: !ruby/object:Gem::Requirement
37
247
  requirements:
38
- - - ! '>='
248
+ - - ">="
249
+ - !ruby/object:Gem::Version
250
+ version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: simplecov
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
39
256
  - !ruby/object:Gem::Version
40
257
  version: '0'
41
- description: Generic messaging for Rails apps. Send and receive messages among users.
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
265
+ description:
42
266
  email:
43
- - trappist@gmail.com
44
- executables: []
267
+ - developers@bukowskis.com
268
+ executables:
269
+ - messaging
45
270
  extensions: []
46
271
  extra_rdoc_files: []
47
272
  files:
48
- - app/models/message.rb
49
- - app/models/receipt.rb
50
- - app/uploaders/attachment_uploader.rb
51
- - db/migrate/20130801214110_initial_migration.rb
52
- - lib/generators/messaging/install_generator.rb
53
- - lib/generators/messaging/templates/initializer.rb
54
- - lib/messaging/concerns/configurable_mailer.rb
55
- - lib/messaging/engine.rb
56
- - lib/messaging/models/messageable.rb
57
- - lib/messaging/version.rb
58
- - lib/messaging.rb
59
- - lib/tasks/messaging_tasks.rake
60
- - MIT-LICENSE
273
+ - ".circleci/config.yml"
274
+ - ".gitignore"
275
+ - ".rspec"
276
+ - ".ruby-version"
277
+ - Gemfile
278
+ - Gemfile.lock
279
+ - README.md
61
280
  - Rakefile
62
- - test/dummy/app/assets/javascripts/application.js
63
- - test/dummy/app/assets/stylesheets/application.css
64
- - test/dummy/app/controllers/application_controller.rb
65
- - test/dummy/app/helpers/application_helper.rb
66
- - test/dummy/app/views/layouts/application.html.erb
67
- - test/dummy/bin/bundle
68
- - test/dummy/bin/rails
69
- - test/dummy/bin/rake
70
- - test/dummy/config/application.rb
71
- - test/dummy/config/boot.rb
72
- - test/dummy/config/database.yml
73
- - test/dummy/config/environment.rb
74
- - test/dummy/config/environments/development.rb
75
- - test/dummy/config/environments/production.rb
76
- - test/dummy/config/environments/test.rb
77
- - test/dummy/config/initializers/backtrace_silencers.rb
78
- - test/dummy/config/initializers/filter_parameter_logging.rb
79
- - test/dummy/config/initializers/inflections.rb
80
- - test/dummy/config/initializers/mime_types.rb
81
- - test/dummy/config/initializers/secret_token.rb
82
- - test/dummy/config/initializers/session_store.rb
83
- - test/dummy/config/initializers/wrap_parameters.rb
84
- - test/dummy/config/locales/en.yml
85
- - test/dummy/config/routes.rb
86
- - test/dummy/config.ru
87
- - test/dummy/public/404.html
88
- - test/dummy/public/422.html
89
- - test/dummy/public/500.html
90
- - test/dummy/public/favicon.ico
91
- - test/dummy/Rakefile
92
- - test/dummy/README.rdoc
93
- - test/messaging_test.rb
94
- - test/test_helper.rb
95
- homepage: https://github.com/trappist/messaging
96
- licenses:
97
- - MIT
281
+ - _config.yml
282
+ - bin/console
283
+ - bin/setup
284
+ - exe/messaging
285
+ - lib/messaging.rb
286
+ - lib/messaging/adapters.rb
287
+ - lib/messaging/adapters/kafka.rb
288
+ - lib/messaging/adapters/kafka/consumer.rb
289
+ - lib/messaging/adapters/kafka/producer.rb
290
+ - lib/messaging/adapters/postgres.rb
291
+ - lib/messaging/adapters/postgres/advisory_transaction_lock.rb
292
+ - lib/messaging/adapters/postgres/serialized_message.rb
293
+ - lib/messaging/adapters/postgres/store.rb
294
+ - lib/messaging/adapters/postgres/stream.rb
295
+ - lib/messaging/adapters/postgres/streams.rb
296
+ - lib/messaging/adapters/test.rb
297
+ - lib/messaging/adapters/test/consumer.rb
298
+ - lib/messaging/adapters/test/store.rb
299
+ - lib/messaging/adapters/test/stream.rb
300
+ - lib/messaging/base_handler.rb
301
+ - lib/messaging/cli.rb
302
+ - lib/messaging/config.rb
303
+ - lib/messaging/consumer_supervisor.rb
304
+ - lib/messaging/exception_handler.rb
305
+ - lib/messaging/expected_version.rb
306
+ - lib/messaging/instrumentation.rb
307
+ - lib/messaging/message.rb
308
+ - lib/messaging/message/from_json.rb
309
+ - lib/messaging/meter.rb
310
+ - lib/messaging/middleware.rb
311
+ - lib/messaging/middleware/after_active_record_transaction.rb
312
+ - lib/messaging/middleware/rails_wrapper.rb
313
+ - lib/messaging/publish.rb
314
+ - lib/messaging/rails/railtie.rb
315
+ - lib/messaging/resque_worker.rb
316
+ - lib/messaging/routes.rb
317
+ - lib/messaging/routing.rb
318
+ - lib/messaging/routing/background_job_subscriber.rb
319
+ - lib/messaging/routing/enqueue_message_handler.rb
320
+ - lib/messaging/routing/message_matcher.rb
321
+ - lib/messaging/routing/subscriber.rb
322
+ - lib/messaging/sidekiq_worker.rb
323
+ - lib/messaging/version.rb
324
+ - messaging.gemspec
325
+ homepage: https://bukowskis.github.io/messaging/
326
+ licenses: []
98
327
  metadata: {}
99
328
  post_install_message:
100
329
  rdoc_options: []
@@ -102,51 +331,19 @@ require_paths:
102
331
  - lib
103
332
  required_ruby_version: !ruby/object:Gem::Requirement
104
333
  requirements:
105
- - - ! '>='
334
+ - - ">="
106
335
  - !ruby/object:Gem::Version
107
336
  version: '0'
108
337
  required_rubygems_version: !ruby/object:Gem::Requirement
109
338
  requirements:
110
- - - ! '>='
339
+ - - ">="
111
340
  - !ruby/object:Gem::Version
112
341
  version: '0'
113
342
  requirements: []
114
343
  rubyforge_project:
115
- rubygems_version: 2.0.5
344
+ rubygems_version: 2.5.1
116
345
  signing_key:
117
346
  specification_version: 4
118
- summary: Generic messaging for Rails apps
119
- test_files:
120
- - test/dummy/app/assets/javascripts/application.js
121
- - test/dummy/app/assets/stylesheets/application.css
122
- - test/dummy/app/controllers/application_controller.rb
123
- - test/dummy/app/helpers/application_helper.rb
124
- - test/dummy/app/views/layouts/application.html.erb
125
- - test/dummy/bin/bundle
126
- - test/dummy/bin/rails
127
- - test/dummy/bin/rake
128
- - test/dummy/config/application.rb
129
- - test/dummy/config/boot.rb
130
- - test/dummy/config/database.yml
131
- - test/dummy/config/environment.rb
132
- - test/dummy/config/environments/development.rb
133
- - test/dummy/config/environments/production.rb
134
- - test/dummy/config/environments/test.rb
135
- - test/dummy/config/initializers/backtrace_silencers.rb
136
- - test/dummy/config/initializers/filter_parameter_logging.rb
137
- - test/dummy/config/initializers/inflections.rb
138
- - test/dummy/config/initializers/mime_types.rb
139
- - test/dummy/config/initializers/secret_token.rb
140
- - test/dummy/config/initializers/session_store.rb
141
- - test/dummy/config/initializers/wrap_parameters.rb
142
- - test/dummy/config/locales/en.yml
143
- - test/dummy/config/routes.rb
144
- - test/dummy/config.ru
145
- - test/dummy/public/404.html
146
- - test/dummy/public/422.html
147
- - test/dummy/public/500.html
148
- - test/dummy/public/favicon.ico
149
- - test/dummy/Rakefile
150
- - test/dummy/README.rdoc
151
- - test/messaging_test.rb
152
- - test/test_helper.rb
347
+ summary: A library for decoupling applications by using messaging to communicate between
348
+ components.
349
+ test_files: []