nats_pubsub 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/exe/nats_pubsub +44 -0
- data/lib/generators/nats_pubsub/config/config_generator.rb +174 -0
- data/lib/generators/nats_pubsub/config/templates/env.example.tt +46 -0
- data/lib/generators/nats_pubsub/config/templates/nats_pubsub.rb.tt +105 -0
- data/lib/generators/nats_pubsub/initializer/initializer_generator.rb +36 -0
- data/lib/generators/nats_pubsub/initializer/templates/nats_pubsub.rb +27 -0
- data/lib/generators/nats_pubsub/install/install_generator.rb +75 -0
- data/lib/generators/nats_pubsub/migrations/migrations_generator.rb +74 -0
- data/lib/generators/nats_pubsub/migrations/templates/create_nats_pubsub_inbox.rb.erb +88 -0
- data/lib/generators/nats_pubsub/migrations/templates/create_nats_pubsub_outbox.rb.erb +81 -0
- data/lib/generators/nats_pubsub/subscriber/subscriber_generator.rb +139 -0
- data/lib/generators/nats_pubsub/subscriber/templates/subscriber.rb.tt +117 -0
- data/lib/generators/nats_pubsub/subscriber/templates/subscriber_spec.rb.tt +116 -0
- data/lib/generators/nats_pubsub/subscriber/templates/subscriber_test.rb.tt +117 -0
- data/lib/nats_pubsub/active_record/publishable.rb +192 -0
- data/lib/nats_pubsub/cli.rb +105 -0
- data/lib/nats_pubsub/core/base_repository.rb +73 -0
- data/lib/nats_pubsub/core/config.rb +152 -0
- data/lib/nats_pubsub/core/config_presets.rb +139 -0
- data/lib/nats_pubsub/core/connection.rb +103 -0
- data/lib/nats_pubsub/core/constants.rb +190 -0
- data/lib/nats_pubsub/core/duration.rb +113 -0
- data/lib/nats_pubsub/core/error_action.rb +288 -0
- data/lib/nats_pubsub/core/event.rb +275 -0
- data/lib/nats_pubsub/core/health_check.rb +470 -0
- data/lib/nats_pubsub/core/logging.rb +72 -0
- data/lib/nats_pubsub/core/message_context.rb +193 -0
- data/lib/nats_pubsub/core/presets.rb +222 -0
- data/lib/nats_pubsub/core/retry_strategy.rb +71 -0
- data/lib/nats_pubsub/core/structured_logger.rb +141 -0
- data/lib/nats_pubsub/core/subject.rb +185 -0
- data/lib/nats_pubsub/instrumentation.rb +327 -0
- data/lib/nats_pubsub/middleware/active_record.rb +18 -0
- data/lib/nats_pubsub/middleware/chain.rb +92 -0
- data/lib/nats_pubsub/middleware/logging.rb +48 -0
- data/lib/nats_pubsub/middleware/retry_logger.rb +24 -0
- data/lib/nats_pubsub/middleware/structured_logging.rb +57 -0
- data/lib/nats_pubsub/models/event_model.rb +73 -0
- data/lib/nats_pubsub/models/inbox_event.rb +109 -0
- data/lib/nats_pubsub/models/model_codec_setup.rb +61 -0
- data/lib/nats_pubsub/models/model_utils.rb +57 -0
- data/lib/nats_pubsub/models/outbox_event.rb +113 -0
- data/lib/nats_pubsub/publisher/envelope_builder.rb +99 -0
- data/lib/nats_pubsub/publisher/fluent_batch.rb +262 -0
- data/lib/nats_pubsub/publisher/outbox_publisher.rb +97 -0
- data/lib/nats_pubsub/publisher/outbox_repository.rb +117 -0
- data/lib/nats_pubsub/publisher/publish_argument_parser.rb +108 -0
- data/lib/nats_pubsub/publisher/publish_result.rb +149 -0
- data/lib/nats_pubsub/publisher/publisher.rb +156 -0
- data/lib/nats_pubsub/rails/health_endpoint.rb +239 -0
- data/lib/nats_pubsub/railtie.rb +52 -0
- data/lib/nats_pubsub/subscribers/dlq_handler.rb +69 -0
- data/lib/nats_pubsub/subscribers/error_context.rb +137 -0
- data/lib/nats_pubsub/subscribers/error_handler.rb +110 -0
- data/lib/nats_pubsub/subscribers/graceful_shutdown.rb +128 -0
- data/lib/nats_pubsub/subscribers/inbox/inbox_message.rb +79 -0
- data/lib/nats_pubsub/subscribers/inbox/inbox_processor.rb +53 -0
- data/lib/nats_pubsub/subscribers/inbox/inbox_repository.rb +74 -0
- data/lib/nats_pubsub/subscribers/message_context.rb +86 -0
- data/lib/nats_pubsub/subscribers/message_processor.rb +225 -0
- data/lib/nats_pubsub/subscribers/message_router.rb +77 -0
- data/lib/nats_pubsub/subscribers/pool.rb +166 -0
- data/lib/nats_pubsub/subscribers/registry.rb +114 -0
- data/lib/nats_pubsub/subscribers/subscriber.rb +186 -0
- data/lib/nats_pubsub/subscribers/subscription_manager.rb +206 -0
- data/lib/nats_pubsub/subscribers/worker.rb +152 -0
- data/lib/nats_pubsub/tasks/install.rake +10 -0
- data/lib/nats_pubsub/testing/helpers.rb +199 -0
- data/lib/nats_pubsub/testing/matchers.rb +208 -0
- data/lib/nats_pubsub/testing/test_harness.rb +250 -0
- data/lib/nats_pubsub/testing.rb +157 -0
- data/lib/nats_pubsub/topology/overlap_guard.rb +88 -0
- data/lib/nats_pubsub/topology/stream.rb +102 -0
- data/lib/nats_pubsub/topology/stream_support.rb +170 -0
- data/lib/nats_pubsub/topology/subject_matcher.rb +77 -0
- data/lib/nats_pubsub/topology/topology.rb +24 -0
- data/lib/nats_pubsub/version.rb +8 -0
- data/lib/nats_pubsub/web/views/dashboard.erb +55 -0
- data/lib/nats_pubsub/web/views/inbox_detail.erb +91 -0
- data/lib/nats_pubsub/web/views/inbox_list.erb +62 -0
- data/lib/nats_pubsub/web/views/layout.erb +68 -0
- data/lib/nats_pubsub/web/views/outbox_detail.erb +77 -0
- data/lib/nats_pubsub/web/views/outbox_list.erb +62 -0
- data/lib/nats_pubsub/web.rb +181 -0
- data/lib/nats_pubsub.rb +290 -0
- metadata +225 -0
data/lib/nats_pubsub.rb
ADDED
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# NatsPubsub - Declarative PubSub messaging for NATS JetStream
|
|
4
|
+
module NatsPubsub
|
|
5
|
+
class Error < StandardError; end
|
|
6
|
+
class ConfigurationError < Error; end
|
|
7
|
+
class ConnectionError < Error; end
|
|
8
|
+
class PublishError < Error; end
|
|
9
|
+
class SubscriptionError < Error; end
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
# Load version first
|
|
13
|
+
require_relative 'nats_pubsub/version'
|
|
14
|
+
|
|
15
|
+
# Core dependencies
|
|
16
|
+
require_relative 'nats_pubsub/core/constants'
|
|
17
|
+
require_relative 'nats_pubsub/core/config'
|
|
18
|
+
require_relative 'nats_pubsub/core/config_presets'
|
|
19
|
+
require_relative 'nats_pubsub/core/duration'
|
|
20
|
+
require_relative 'nats_pubsub/core/subject'
|
|
21
|
+
require_relative 'nats_pubsub/core/event'
|
|
22
|
+
require_relative 'nats_pubsub/core/logging'
|
|
23
|
+
require_relative 'nats_pubsub/core/structured_logger'
|
|
24
|
+
require_relative 'nats_pubsub/core/connection'
|
|
25
|
+
require_relative 'nats_pubsub/core/retry_strategy'
|
|
26
|
+
require_relative 'nats_pubsub/core/base_repository'
|
|
27
|
+
require_relative 'nats_pubsub/core/message_context'
|
|
28
|
+
require_relative 'nats_pubsub/core/error_action'
|
|
29
|
+
require_relative 'nats_pubsub/core/presets'
|
|
30
|
+
require_relative 'nats_pubsub/core/health_check'
|
|
31
|
+
|
|
32
|
+
# Model utilities
|
|
33
|
+
require_relative 'nats_pubsub/models/model_utils'
|
|
34
|
+
require_relative 'nats_pubsub/models/model_codec_setup'
|
|
35
|
+
require_relative 'nats_pubsub/models/event_model'
|
|
36
|
+
|
|
37
|
+
# Publisher components
|
|
38
|
+
require_relative 'nats_pubsub/publisher/envelope_builder'
|
|
39
|
+
require_relative 'nats_pubsub/publisher/publish_result'
|
|
40
|
+
require_relative 'nats_pubsub/publisher/publish_argument_parser'
|
|
41
|
+
require_relative 'nats_pubsub/publisher/outbox_repository'
|
|
42
|
+
require_relative 'nats_pubsub/publisher/outbox_publisher'
|
|
43
|
+
require_relative 'nats_pubsub/publisher/publisher'
|
|
44
|
+
require_relative 'nats_pubsub/publisher/fluent_batch'
|
|
45
|
+
|
|
46
|
+
# Subscriber system (consolidated from consumer)
|
|
47
|
+
require_relative 'nats_pubsub/subscribers/worker'
|
|
48
|
+
require_relative 'nats_pubsub/subscribers/message_context'
|
|
49
|
+
require_relative 'nats_pubsub/subscribers/error_context'
|
|
50
|
+
require_relative 'nats_pubsub/subscribers/error_handler'
|
|
51
|
+
require_relative 'nats_pubsub/subscribers/graceful_shutdown'
|
|
52
|
+
require_relative 'nats_pubsub/subscribers/message_processor'
|
|
53
|
+
require_relative 'nats_pubsub/subscribers/subscription_manager'
|
|
54
|
+
require_relative 'nats_pubsub/subscribers/dlq_handler'
|
|
55
|
+
require_relative 'nats_pubsub/subscribers/message_router'
|
|
56
|
+
require_relative 'nats_pubsub/subscribers/pool'
|
|
57
|
+
require_relative 'nats_pubsub/subscribers/inbox/inbox_message'
|
|
58
|
+
require_relative 'nats_pubsub/subscribers/inbox/inbox_processor'
|
|
59
|
+
require_relative 'nats_pubsub/subscribers/inbox/inbox_repository'
|
|
60
|
+
require_relative 'nats_pubsub/subscribers/subscriber'
|
|
61
|
+
require_relative 'nats_pubsub/subscribers/registry'
|
|
62
|
+
|
|
63
|
+
# Topology management
|
|
64
|
+
require_relative 'nats_pubsub/topology/subject_matcher'
|
|
65
|
+
require_relative 'nats_pubsub/topology/overlap_guard'
|
|
66
|
+
require_relative 'nats_pubsub/topology/stream_support'
|
|
67
|
+
require_relative 'nats_pubsub/topology/stream'
|
|
68
|
+
require_relative 'nats_pubsub/topology/topology'
|
|
69
|
+
|
|
70
|
+
# Middleware
|
|
71
|
+
require_relative 'nats_pubsub/middleware/chain'
|
|
72
|
+
require_relative 'nats_pubsub/middleware/logging'
|
|
73
|
+
require_relative 'nats_pubsub/middleware/structured_logging'
|
|
74
|
+
require_relative 'nats_pubsub/middleware/active_record'
|
|
75
|
+
require_relative 'nats_pubsub/middleware/retry_logger'
|
|
76
|
+
|
|
77
|
+
# Models
|
|
78
|
+
require_relative 'nats_pubsub/models/inbox_event'
|
|
79
|
+
require_relative 'nats_pubsub/models/outbox_event'
|
|
80
|
+
|
|
81
|
+
# Optional: ActiveRecord integration
|
|
82
|
+
require_relative 'nats_pubsub/active_record/publishable' if defined?(ActiveRecord)
|
|
83
|
+
|
|
84
|
+
# Optional: Rails integration
|
|
85
|
+
require_relative 'nats_pubsub/railtie' if defined?(Rails::Railtie)
|
|
86
|
+
|
|
87
|
+
# Optional: Web UI (requires Sinatra)
|
|
88
|
+
begin
|
|
89
|
+
require 'sinatra/base'
|
|
90
|
+
require_relative 'nats_pubsub/web'
|
|
91
|
+
rescue LoadError
|
|
92
|
+
# Sinatra not installed, skip Web UI
|
|
93
|
+
end
|
|
94
|
+
|
|
95
|
+
# Optional: Testing utilities
|
|
96
|
+
require_relative 'nats_pubsub/testing' if defined?(RSpec)
|
|
97
|
+
require_relative 'nats_pubsub/testing/test_harness' if defined?(RSpec)
|
|
98
|
+
|
|
99
|
+
# NatsPubsub main module extensions.
|
|
100
|
+
module NatsPubsub
|
|
101
|
+
class << self
|
|
102
|
+
def config
|
|
103
|
+
@config ||= Config.new
|
|
104
|
+
end
|
|
105
|
+
|
|
106
|
+
def configure(overrides = {})
|
|
107
|
+
cfg = config
|
|
108
|
+
overrides.each { |k, v| assign!(cfg, k, v) } unless overrides.nil? || overrides.empty?
|
|
109
|
+
yield(cfg) if block_given?
|
|
110
|
+
cfg
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def reset!
|
|
114
|
+
@config = nil
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
def use_outbox?
|
|
118
|
+
config.use_outbox
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
def use_inbox?
|
|
122
|
+
config.use_inbox
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
def use_dlq?
|
|
126
|
+
config.use_dlq
|
|
127
|
+
end
|
|
128
|
+
|
|
129
|
+
# Establishes a connection and ensures stream topology.
|
|
130
|
+
# This is the recommended way to initialize the system.
|
|
131
|
+
#
|
|
132
|
+
# @return [Object] JetStream context
|
|
133
|
+
def ensure_topology!
|
|
134
|
+
jts = Connection.connect!
|
|
135
|
+
Topology.ensure!(jts)
|
|
136
|
+
jts
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# Publish a message to a topic
|
|
140
|
+
#
|
|
141
|
+
# @param topic [String] Topic name (e.g., 'orders.created', 'notifications.email.send')
|
|
142
|
+
# @param message [Hash] Message payload
|
|
143
|
+
# @param options [Hash] Additional options (event_id, trace_id, correlation_id, occurred_at, message_type)
|
|
144
|
+
# @return [PublishResult] Result object with success status and details
|
|
145
|
+
#
|
|
146
|
+
# @example Simple publish
|
|
147
|
+
# result = NatsPubsub.publish(topic: 'orders.created', message: { order_id: '123', amount: 99.99 })
|
|
148
|
+
# puts "Published: #{result.event_id}" if result.success?
|
|
149
|
+
#
|
|
150
|
+
# @example With metadata
|
|
151
|
+
# result = NatsPubsub.publish(
|
|
152
|
+
# topic: 'orders.created',
|
|
153
|
+
# message: { order_id: '123' },
|
|
154
|
+
# trace_id: 'trace-123',
|
|
155
|
+
# correlation_id: 'corr-456'
|
|
156
|
+
# )
|
|
157
|
+
def publish(topic:, message:, **options)
|
|
158
|
+
Publisher.new.publish(topic: topic, message: message, **options)
|
|
159
|
+
end
|
|
160
|
+
|
|
161
|
+
# Create a batch publisher for publishing multiple messages efficiently
|
|
162
|
+
#
|
|
163
|
+
# @yield [FluentBatch] Batch publisher instance
|
|
164
|
+
# @return [FluentBatch] Batch publisher instance for chaining
|
|
165
|
+
#
|
|
166
|
+
# @example Block syntax
|
|
167
|
+
# result = NatsPubsub.batch do |b|
|
|
168
|
+
# b.add 'user.created', { id: 1, name: 'Alice' }
|
|
169
|
+
# b.add 'user.created', { id: 2, name: 'Bob' }
|
|
170
|
+
# b.with_options trace_id: 'batch-123'
|
|
171
|
+
# end.publish
|
|
172
|
+
#
|
|
173
|
+
# @example Chaining syntax
|
|
174
|
+
# result = NatsPubsub.batch
|
|
175
|
+
# .add('user.created', { id: 1 })
|
|
176
|
+
# .add('notification.sent', { user_id: 1 })
|
|
177
|
+
# .publish
|
|
178
|
+
#
|
|
179
|
+
def batch(&block)
|
|
180
|
+
batch_publisher = FluentBatch.new
|
|
181
|
+
yield(batch_publisher) if block_given?
|
|
182
|
+
batch_publisher
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
# Convenience method: Configure and initialize in one call
|
|
186
|
+
# Combines configure + ensure_topology! for simpler setup
|
|
187
|
+
#
|
|
188
|
+
# @yield [Config] Configuration block
|
|
189
|
+
# @return [Object] JetStream context
|
|
190
|
+
#
|
|
191
|
+
# @example
|
|
192
|
+
# NatsPubsub.setup! do |config|
|
|
193
|
+
# config.app_name = 'my_app'
|
|
194
|
+
# config.nats_urls = ['nats://localhost:4222']
|
|
195
|
+
# config.env = 'production'
|
|
196
|
+
# end
|
|
197
|
+
def setup!
|
|
198
|
+
configure { |cfg| yield(cfg) if block_given? }
|
|
199
|
+
config.validate!
|
|
200
|
+
ensure_topology!
|
|
201
|
+
end
|
|
202
|
+
|
|
203
|
+
# Setup with a configuration preset
|
|
204
|
+
# Applies preset defaults, then allows customization, then initializes
|
|
205
|
+
#
|
|
206
|
+
# @param preset [Symbol] Preset name (:development, :production, :testing)
|
|
207
|
+
# @yield [Config] Configuration block for customization
|
|
208
|
+
# @return [Object] JetStream context
|
|
209
|
+
#
|
|
210
|
+
# @example
|
|
211
|
+
# NatsPubsub.setup_with_preset!(:production) do |config|
|
|
212
|
+
# config.nats_urls = ENV['NATS_URLS']
|
|
213
|
+
# config.app_name = 'my-app'
|
|
214
|
+
# end
|
|
215
|
+
def setup_with_preset!(preset)
|
|
216
|
+
# Reset to fresh config
|
|
217
|
+
@config = Config.new(preset: preset)
|
|
218
|
+
|
|
219
|
+
# Allow customization
|
|
220
|
+
yield(config) if block_given?
|
|
221
|
+
|
|
222
|
+
# Validate and connect
|
|
223
|
+
config.validate!
|
|
224
|
+
ensure_topology!
|
|
225
|
+
end
|
|
226
|
+
|
|
227
|
+
# Convenience method: Connect to NATS (idempotent)
|
|
228
|
+
# Alias for ensure_topology! with clearer intent
|
|
229
|
+
#
|
|
230
|
+
# @return [Object] JetStream context
|
|
231
|
+
def connect!
|
|
232
|
+
ensure_topology!
|
|
233
|
+
end
|
|
234
|
+
|
|
235
|
+
# Perform comprehensive health check
|
|
236
|
+
#
|
|
237
|
+
# @return [Core::HealthCheck::Result] Health check result
|
|
238
|
+
#
|
|
239
|
+
# @example
|
|
240
|
+
# status = NatsPubsub.health_check
|
|
241
|
+
# puts "Status: #{status.status}"
|
|
242
|
+
# puts "Healthy: #{status.healthy?}"
|
|
243
|
+
def health_check
|
|
244
|
+
Core::HealthCheck.check
|
|
245
|
+
end
|
|
246
|
+
|
|
247
|
+
# Perform quick health check (connection only)
|
|
248
|
+
#
|
|
249
|
+
# @return [Core::HealthCheck::Result] Health check result
|
|
250
|
+
#
|
|
251
|
+
# @example
|
|
252
|
+
# status = NatsPubsub.quick_health_check
|
|
253
|
+
# puts "Healthy: #{status.healthy?}"
|
|
254
|
+
def quick_health_check
|
|
255
|
+
Core::HealthCheck.quick_check
|
|
256
|
+
end
|
|
257
|
+
|
|
258
|
+
# Get health check middleware for Rack apps
|
|
259
|
+
#
|
|
260
|
+
# @return [Proc] Rack middleware
|
|
261
|
+
#
|
|
262
|
+
# @example Sinatra
|
|
263
|
+
# get '/health' do
|
|
264
|
+
# status, headers, body = NatsPubsub.health_check_middleware.call(env)
|
|
265
|
+
# [status, headers, body]
|
|
266
|
+
# end
|
|
267
|
+
#
|
|
268
|
+
# @example Rails
|
|
269
|
+
# get '/health', to: NatsPubsub.health_check_middleware
|
|
270
|
+
def health_check_middleware
|
|
271
|
+
Core::HealthCheck.middleware
|
|
272
|
+
end
|
|
273
|
+
|
|
274
|
+
# Get quick health check middleware for Rack apps
|
|
275
|
+
#
|
|
276
|
+
# @return [Proc] Rack middleware
|
|
277
|
+
def quick_health_check_middleware
|
|
278
|
+
Core::HealthCheck.quick_middleware
|
|
279
|
+
end
|
|
280
|
+
|
|
281
|
+
private
|
|
282
|
+
|
|
283
|
+
def assign!(cfg, key, val)
|
|
284
|
+
setter = :"#{key}="
|
|
285
|
+
raise ArgumentError, "Unknown configuration option: #{key}" unless cfg.respond_to?(setter)
|
|
286
|
+
|
|
287
|
+
cfg.public_send(setter, val)
|
|
288
|
+
end
|
|
289
|
+
end
|
|
290
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: nats_pubsub
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Mike Attara
|
|
8
|
+
bindir: exe
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: activerecord
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '6.0'
|
|
19
|
+
- - "<"
|
|
20
|
+
- !ruby/object:Gem::Version
|
|
21
|
+
version: '9'
|
|
22
|
+
type: :runtime
|
|
23
|
+
prerelease: false
|
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
25
|
+
requirements:
|
|
26
|
+
- - ">="
|
|
27
|
+
- !ruby/object:Gem::Version
|
|
28
|
+
version: '6.0'
|
|
29
|
+
- - "<"
|
|
30
|
+
- !ruby/object:Gem::Version
|
|
31
|
+
version: '9'
|
|
32
|
+
- !ruby/object:Gem::Dependency
|
|
33
|
+
name: activesupport
|
|
34
|
+
requirement: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '6.0'
|
|
39
|
+
- - "<"
|
|
40
|
+
- !ruby/object:Gem::Version
|
|
41
|
+
version: '9'
|
|
42
|
+
type: :runtime
|
|
43
|
+
prerelease: false
|
|
44
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
45
|
+
requirements:
|
|
46
|
+
- - ">="
|
|
47
|
+
- !ruby/object:Gem::Version
|
|
48
|
+
version: '6.0'
|
|
49
|
+
- - "<"
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: '9'
|
|
52
|
+
- !ruby/object:Gem::Dependency
|
|
53
|
+
name: nats-pure
|
|
54
|
+
requirement: !ruby/object:Gem::Requirement
|
|
55
|
+
requirements:
|
|
56
|
+
- - "~>"
|
|
57
|
+
- !ruby/object:Gem::Version
|
|
58
|
+
version: '2.5'
|
|
59
|
+
type: :runtime
|
|
60
|
+
prerelease: false
|
|
61
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
62
|
+
requirements:
|
|
63
|
+
- - "~>"
|
|
64
|
+
- !ruby/object:Gem::Version
|
|
65
|
+
version: '2.5'
|
|
66
|
+
- !ruby/object:Gem::Dependency
|
|
67
|
+
name: oj
|
|
68
|
+
requirement: !ruby/object:Gem::Requirement
|
|
69
|
+
requirements:
|
|
70
|
+
- - "~>"
|
|
71
|
+
- !ruby/object:Gem::Version
|
|
72
|
+
version: '3.16'
|
|
73
|
+
type: :runtime
|
|
74
|
+
prerelease: false
|
|
75
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
76
|
+
requirements:
|
|
77
|
+
- - "~>"
|
|
78
|
+
- !ruby/object:Gem::Version
|
|
79
|
+
version: '3.16'
|
|
80
|
+
- !ruby/object:Gem::Dependency
|
|
81
|
+
name: sinatra
|
|
82
|
+
requirement: !ruby/object:Gem::Requirement
|
|
83
|
+
requirements:
|
|
84
|
+
- - ">="
|
|
85
|
+
- !ruby/object:Gem::Version
|
|
86
|
+
version: '3'
|
|
87
|
+
- - "<"
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: '5'
|
|
90
|
+
type: :runtime
|
|
91
|
+
prerelease: false
|
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
93
|
+
requirements:
|
|
94
|
+
- - ">="
|
|
95
|
+
- !ruby/object:Gem::Version
|
|
96
|
+
version: '3'
|
|
97
|
+
- - "<"
|
|
98
|
+
- !ruby/object:Gem::Version
|
|
99
|
+
version: '5'
|
|
100
|
+
description: |-
|
|
101
|
+
A production-ready pub/sub library for NATS JetStream with Rails integration.
|
|
102
|
+
Features declarative subscribers, auto-discovery, middleware support, Web UI
|
|
103
|
+
for monitoring Inbox/Outbox events, and production-ready patterns including
|
|
104
|
+
Inbox/Outbox, DLQ, and automatic retries with backoff.
|
|
105
|
+
email:
|
|
106
|
+
- mpyebattara@gmail.com
|
|
107
|
+
executables:
|
|
108
|
+
- nats_pubsub
|
|
109
|
+
extensions: []
|
|
110
|
+
extra_rdoc_files: []
|
|
111
|
+
files:
|
|
112
|
+
- exe/nats_pubsub
|
|
113
|
+
- lib/generators/nats_pubsub/config/config_generator.rb
|
|
114
|
+
- lib/generators/nats_pubsub/config/templates/env.example.tt
|
|
115
|
+
- lib/generators/nats_pubsub/config/templates/nats_pubsub.rb.tt
|
|
116
|
+
- lib/generators/nats_pubsub/initializer/initializer_generator.rb
|
|
117
|
+
- lib/generators/nats_pubsub/initializer/templates/nats_pubsub.rb
|
|
118
|
+
- lib/generators/nats_pubsub/install/install_generator.rb
|
|
119
|
+
- lib/generators/nats_pubsub/migrations/migrations_generator.rb
|
|
120
|
+
- lib/generators/nats_pubsub/migrations/templates/create_nats_pubsub_inbox.rb.erb
|
|
121
|
+
- lib/generators/nats_pubsub/migrations/templates/create_nats_pubsub_outbox.rb.erb
|
|
122
|
+
- lib/generators/nats_pubsub/subscriber/subscriber_generator.rb
|
|
123
|
+
- lib/generators/nats_pubsub/subscriber/templates/subscriber.rb.tt
|
|
124
|
+
- lib/generators/nats_pubsub/subscriber/templates/subscriber_spec.rb.tt
|
|
125
|
+
- lib/generators/nats_pubsub/subscriber/templates/subscriber_test.rb.tt
|
|
126
|
+
- lib/nats_pubsub.rb
|
|
127
|
+
- lib/nats_pubsub/active_record/publishable.rb
|
|
128
|
+
- lib/nats_pubsub/cli.rb
|
|
129
|
+
- lib/nats_pubsub/core/base_repository.rb
|
|
130
|
+
- lib/nats_pubsub/core/config.rb
|
|
131
|
+
- lib/nats_pubsub/core/config_presets.rb
|
|
132
|
+
- lib/nats_pubsub/core/connection.rb
|
|
133
|
+
- lib/nats_pubsub/core/constants.rb
|
|
134
|
+
- lib/nats_pubsub/core/duration.rb
|
|
135
|
+
- lib/nats_pubsub/core/error_action.rb
|
|
136
|
+
- lib/nats_pubsub/core/event.rb
|
|
137
|
+
- lib/nats_pubsub/core/health_check.rb
|
|
138
|
+
- lib/nats_pubsub/core/logging.rb
|
|
139
|
+
- lib/nats_pubsub/core/message_context.rb
|
|
140
|
+
- lib/nats_pubsub/core/presets.rb
|
|
141
|
+
- lib/nats_pubsub/core/retry_strategy.rb
|
|
142
|
+
- lib/nats_pubsub/core/structured_logger.rb
|
|
143
|
+
- lib/nats_pubsub/core/subject.rb
|
|
144
|
+
- lib/nats_pubsub/instrumentation.rb
|
|
145
|
+
- lib/nats_pubsub/middleware/active_record.rb
|
|
146
|
+
- lib/nats_pubsub/middleware/chain.rb
|
|
147
|
+
- lib/nats_pubsub/middleware/logging.rb
|
|
148
|
+
- lib/nats_pubsub/middleware/retry_logger.rb
|
|
149
|
+
- lib/nats_pubsub/middleware/structured_logging.rb
|
|
150
|
+
- lib/nats_pubsub/models/event_model.rb
|
|
151
|
+
- lib/nats_pubsub/models/inbox_event.rb
|
|
152
|
+
- lib/nats_pubsub/models/model_codec_setup.rb
|
|
153
|
+
- lib/nats_pubsub/models/model_utils.rb
|
|
154
|
+
- lib/nats_pubsub/models/outbox_event.rb
|
|
155
|
+
- lib/nats_pubsub/publisher/envelope_builder.rb
|
|
156
|
+
- lib/nats_pubsub/publisher/fluent_batch.rb
|
|
157
|
+
- lib/nats_pubsub/publisher/outbox_publisher.rb
|
|
158
|
+
- lib/nats_pubsub/publisher/outbox_repository.rb
|
|
159
|
+
- lib/nats_pubsub/publisher/publish_argument_parser.rb
|
|
160
|
+
- lib/nats_pubsub/publisher/publish_result.rb
|
|
161
|
+
- lib/nats_pubsub/publisher/publisher.rb
|
|
162
|
+
- lib/nats_pubsub/rails/health_endpoint.rb
|
|
163
|
+
- lib/nats_pubsub/railtie.rb
|
|
164
|
+
- lib/nats_pubsub/subscribers/dlq_handler.rb
|
|
165
|
+
- lib/nats_pubsub/subscribers/error_context.rb
|
|
166
|
+
- lib/nats_pubsub/subscribers/error_handler.rb
|
|
167
|
+
- lib/nats_pubsub/subscribers/graceful_shutdown.rb
|
|
168
|
+
- lib/nats_pubsub/subscribers/inbox/inbox_message.rb
|
|
169
|
+
- lib/nats_pubsub/subscribers/inbox/inbox_processor.rb
|
|
170
|
+
- lib/nats_pubsub/subscribers/inbox/inbox_repository.rb
|
|
171
|
+
- lib/nats_pubsub/subscribers/message_context.rb
|
|
172
|
+
- lib/nats_pubsub/subscribers/message_processor.rb
|
|
173
|
+
- lib/nats_pubsub/subscribers/message_router.rb
|
|
174
|
+
- lib/nats_pubsub/subscribers/pool.rb
|
|
175
|
+
- lib/nats_pubsub/subscribers/registry.rb
|
|
176
|
+
- lib/nats_pubsub/subscribers/subscriber.rb
|
|
177
|
+
- lib/nats_pubsub/subscribers/subscription_manager.rb
|
|
178
|
+
- lib/nats_pubsub/subscribers/worker.rb
|
|
179
|
+
- lib/nats_pubsub/tasks/install.rake
|
|
180
|
+
- lib/nats_pubsub/testing.rb
|
|
181
|
+
- lib/nats_pubsub/testing/helpers.rb
|
|
182
|
+
- lib/nats_pubsub/testing/matchers.rb
|
|
183
|
+
- lib/nats_pubsub/testing/test_harness.rb
|
|
184
|
+
- lib/nats_pubsub/topology/overlap_guard.rb
|
|
185
|
+
- lib/nats_pubsub/topology/stream.rb
|
|
186
|
+
- lib/nats_pubsub/topology/stream_support.rb
|
|
187
|
+
- lib/nats_pubsub/topology/subject_matcher.rb
|
|
188
|
+
- lib/nats_pubsub/topology/topology.rb
|
|
189
|
+
- lib/nats_pubsub/version.rb
|
|
190
|
+
- lib/nats_pubsub/web.rb
|
|
191
|
+
- lib/nats_pubsub/web/views/dashboard.erb
|
|
192
|
+
- lib/nats_pubsub/web/views/inbox_detail.erb
|
|
193
|
+
- lib/nats_pubsub/web/views/inbox_list.erb
|
|
194
|
+
- lib/nats_pubsub/web/views/layout.erb
|
|
195
|
+
- lib/nats_pubsub/web/views/outbox_detail.erb
|
|
196
|
+
- lib/nats_pubsub/web/views/outbox_list.erb
|
|
197
|
+
homepage: https://github.com/attaradev/nats-pubsub
|
|
198
|
+
licenses:
|
|
199
|
+
- MIT
|
|
200
|
+
metadata:
|
|
201
|
+
homepage_uri: https://github.com/attaradev/nats-pubsub
|
|
202
|
+
source_code_uri: https://github.com/attaradev/nats-pubsub
|
|
203
|
+
changelog_uri: https://github.com/attaradev/nats-pubsub/blob/main/packages/ruby/CHANGELOG.md
|
|
204
|
+
documentation_uri: https://github.com/attaradev/nats-pubsub#readme
|
|
205
|
+
bug_tracker_uri: https://github.com/attaradev/nats-pubsub/issues
|
|
206
|
+
github_repo: ssh://github.com/attaradev/nats-pubsub
|
|
207
|
+
rubygems_mfa_required: 'true'
|
|
208
|
+
rdoc_options: []
|
|
209
|
+
require_paths:
|
|
210
|
+
- lib
|
|
211
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
212
|
+
requirements:
|
|
213
|
+
- - ">="
|
|
214
|
+
- !ruby/object:Gem::Version
|
|
215
|
+
version: 3.2.0
|
|
216
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
|
+
requirements:
|
|
218
|
+
- - ">="
|
|
219
|
+
- !ruby/object:Gem::Version
|
|
220
|
+
version: 3.3.0
|
|
221
|
+
requirements: []
|
|
222
|
+
rubygems_version: 3.6.9
|
|
223
|
+
specification_version: 4
|
|
224
|
+
summary: Declarative PubSub messaging for NATS JetStream
|
|
225
|
+
test_files: []
|