outboxable 1.0.4 → 1.0.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +6 -6
- data/Gemfile.lock +55 -39
- data/README.md +2 -2
- data/lib/generators/outboxable/install_generator.rb +2 -2
- data/lib/outboxable/configuration.rb +1 -1
- data/lib/outboxable/version.rb +1 -1
- data/lib/outboxable.rb +1 -1
- data/lib/templates/activerecord_initializer.rb +1 -1
- data/lib/templates/activerecrod_outbox.rb +7 -3
- data/lib/templates/mongoid_initializer.rb +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 76d6c0bbb3fb689283974ded8b3ab8b6dfd0e804919b05ad190d6da015ac6c69
|
4
|
+
data.tar.gz: 7d023e8c5e9cbe31bbc9aa13efb83489926ac972261cf5665b103ae2dbe94950
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ad7517c04ec75afc04610c2848f0aaf951568fae46329fbb91fb2bb5fbbb60a09ea7e305934885fe182e93e528a5ac82da1878dc44c4dc8f000d6c476c1bbfb9
|
7
|
+
data.tar.gz: 015c4e12f911950dfce7407e447d16b1d61555b5a9617db52e882f614eedcefcc92ceefb3b6b967516940479dde84659712bbd5fdcce2f54e677f89a5d1ec499
|
data/Gemfile
CHANGED
@@ -5,12 +5,12 @@ source 'https://rubygems.org'
|
|
5
5
|
# Specify your gem's dependencies in outboxable.gemspec
|
6
6
|
gemspec
|
7
7
|
|
8
|
-
gem 'rake', '~> 13.
|
9
|
-
gem 'rspec', '~> 3.
|
10
|
-
gem 'rubocop-rails', '~> 2.
|
8
|
+
gem 'rake', '~> 13.1'
|
9
|
+
gem 'rspec', '~> 3.12'
|
10
|
+
gem 'rubocop-rails', '~> 2.22'
|
11
11
|
|
12
12
|
group :development, :test do
|
13
|
-
gem 'activesupport', '~> 7.
|
14
|
-
gem 'sidekiq', '~> 7.
|
15
|
-
gem 'sidekiq-cron', '~> 1.
|
13
|
+
gem 'activesupport', '~> 7.1'
|
14
|
+
gem 'sidekiq', '~> 7.2'
|
15
|
+
gem 'sidekiq-cron', '~> 1.11'
|
16
16
|
end
|
data/Gemfile.lock
CHANGED
@@ -1,86 +1,102 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
outboxable (1.0.
|
5
|
-
bunny (>= 2.
|
6
|
-
connection_pool (~> 2.
|
4
|
+
outboxable (1.0.6)
|
5
|
+
bunny (>= 2.22)
|
6
|
+
connection_pool (~> 2.4)
|
7
7
|
|
8
8
|
GEM
|
9
9
|
remote: https://rubygems.org/
|
10
10
|
specs:
|
11
|
-
activesupport (7.
|
11
|
+
activesupport (7.1.2)
|
12
|
+
base64
|
13
|
+
bigdecimal
|
12
14
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
15
|
+
connection_pool (>= 2.2.5)
|
16
|
+
drb
|
13
17
|
i18n (>= 1.6, < 2)
|
14
18
|
minitest (>= 5.1)
|
19
|
+
mutex_m
|
15
20
|
tzinfo (~> 2.0)
|
16
21
|
amq-protocol (2.3.2)
|
17
22
|
ast (2.4.2)
|
18
|
-
|
23
|
+
base64 (0.2.0)
|
24
|
+
bigdecimal (3.1.4)
|
25
|
+
bunny (2.22.0)
|
19
26
|
amq-protocol (~> 2.3, >= 2.3.1)
|
20
27
|
sorted_set (~> 1, >= 1.0.2)
|
21
28
|
concurrent-ruby (1.2.2)
|
22
|
-
connection_pool (2.
|
29
|
+
connection_pool (2.4.1)
|
23
30
|
diff-lcs (1.5.0)
|
31
|
+
drb (2.2.0)
|
32
|
+
ruby2_keywords
|
24
33
|
et-orbi (1.2.7)
|
25
34
|
tzinfo
|
26
|
-
fugit (1.
|
35
|
+
fugit (1.9.0)
|
27
36
|
et-orbi (~> 1, >= 1.2.7)
|
28
37
|
raabro (~> 1.4)
|
29
|
-
globalid (1.1
|
30
|
-
activesupport (>=
|
31
|
-
i18n (1.
|
38
|
+
globalid (1.2.1)
|
39
|
+
activesupport (>= 6.1)
|
40
|
+
i18n (1.14.1)
|
32
41
|
concurrent-ruby (~> 1.0)
|
33
|
-
json (2.
|
34
|
-
|
35
|
-
|
36
|
-
|
42
|
+
json (2.7.1)
|
43
|
+
language_server-protocol (3.17.0.3)
|
44
|
+
minitest (5.20.0)
|
45
|
+
mutex_m (0.2.0)
|
46
|
+
parallel (1.23.0)
|
47
|
+
parser (3.2.2.4)
|
37
48
|
ast (~> 2.4.1)
|
49
|
+
racc
|
38
50
|
raabro (1.4.0)
|
39
|
-
|
51
|
+
racc (1.7.3)
|
52
|
+
rack (3.0.8)
|
40
53
|
rainbow (3.1.1)
|
41
|
-
rake (13.0
|
54
|
+
rake (13.1.0)
|
42
55
|
rbtree (0.4.6)
|
43
|
-
redis-client (0.
|
56
|
+
redis-client (0.18.0)
|
44
57
|
connection_pool
|
45
|
-
regexp_parser (2.
|
46
|
-
rexml (3.2.
|
58
|
+
regexp_parser (2.8.3)
|
59
|
+
rexml (3.2.6)
|
47
60
|
rspec (3.12.0)
|
48
61
|
rspec-core (~> 3.12.0)
|
49
62
|
rspec-expectations (~> 3.12.0)
|
50
63
|
rspec-mocks (~> 3.12.0)
|
51
|
-
rspec-core (3.12.
|
64
|
+
rspec-core (3.12.2)
|
52
65
|
rspec-support (~> 3.12.0)
|
53
|
-
rspec-expectations (3.12.
|
66
|
+
rspec-expectations (3.12.3)
|
54
67
|
diff-lcs (>= 1.2.0, < 2.0)
|
55
68
|
rspec-support (~> 3.12.0)
|
56
|
-
rspec-mocks (3.12.
|
69
|
+
rspec-mocks (3.12.6)
|
57
70
|
diff-lcs (>= 1.2.0, < 2.0)
|
58
71
|
rspec-support (~> 3.12.0)
|
59
|
-
rspec-support (3.12.
|
60
|
-
rubocop (1.
|
72
|
+
rspec-support (3.12.1)
|
73
|
+
rubocop (1.58.0)
|
61
74
|
json (~> 2.3)
|
75
|
+
language_server-protocol (>= 3.17.0)
|
62
76
|
parallel (~> 1.10)
|
63
|
-
parser (>= 3.2.
|
77
|
+
parser (>= 3.2.2.4)
|
64
78
|
rainbow (>= 2.2.2, < 4.0)
|
65
79
|
regexp_parser (>= 1.8, < 3.0)
|
66
80
|
rexml (>= 3.2.5, < 4.0)
|
67
|
-
rubocop-ast (>= 1.
|
81
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
68
82
|
ruby-progressbar (~> 1.7)
|
69
83
|
unicode-display_width (>= 2.4.0, < 3.0)
|
70
|
-
rubocop-ast (1.
|
84
|
+
rubocop-ast (1.30.0)
|
71
85
|
parser (>= 3.2.1.0)
|
72
|
-
rubocop-rails (2.
|
86
|
+
rubocop-rails (2.22.2)
|
73
87
|
activesupport (>= 4.2.0)
|
74
88
|
rack (>= 1.1)
|
75
89
|
rubocop (>= 1.33.0, < 2.0)
|
90
|
+
rubocop-ast (>= 1.30.0, < 2.0)
|
76
91
|
ruby-progressbar (1.13.0)
|
92
|
+
ruby2_keywords (0.0.5)
|
77
93
|
set (1.0.3)
|
78
|
-
sidekiq (7.0
|
94
|
+
sidekiq (7.2.0)
|
79
95
|
concurrent-ruby (< 2)
|
80
96
|
connection_pool (>= 2.3.0)
|
81
97
|
rack (>= 2.2.4)
|
82
|
-
redis-client (>= 0.
|
83
|
-
sidekiq-cron (1.
|
98
|
+
redis-client (>= 0.14.0)
|
99
|
+
sidekiq-cron (1.11.0)
|
84
100
|
fugit (~> 1.8)
|
85
101
|
globalid (>= 1.0.1)
|
86
102
|
sidekiq (>= 6)
|
@@ -89,19 +105,19 @@ GEM
|
|
89
105
|
set (~> 1.0)
|
90
106
|
tzinfo (2.0.6)
|
91
107
|
concurrent-ruby (~> 1.0)
|
92
|
-
unicode-display_width (2.
|
108
|
+
unicode-display_width (2.5.0)
|
93
109
|
|
94
110
|
PLATFORMS
|
95
111
|
x86_64-linux
|
96
112
|
|
97
113
|
DEPENDENCIES
|
98
|
-
activesupport (~> 7.
|
114
|
+
activesupport (~> 7.1)
|
99
115
|
outboxable!
|
100
|
-
rake (~> 13.
|
101
|
-
rspec (~> 3.
|
102
|
-
rubocop-rails (~> 2.
|
103
|
-
sidekiq (~> 7.
|
104
|
-
sidekiq-cron (~> 1.
|
116
|
+
rake (~> 13.1)
|
117
|
+
rspec (~> 3.12)
|
118
|
+
rubocop-rails (~> 2.22)
|
119
|
+
sidekiq (~> 7.2)
|
120
|
+
sidekiq-cron (~> 1.11)
|
105
121
|
|
106
122
|
BUNDLED WITH
|
107
|
-
2.4.
|
123
|
+
2.4.17
|
data/README.md
CHANGED
@@ -31,7 +31,7 @@ For use with ActiveRecord, run:
|
|
31
31
|
$ rails g outboxable:install --orm activerecord
|
32
32
|
```
|
33
33
|
|
34
|
-
For use with Mongoid, run:
|
34
|
+
For use with Mongoid, run:
|
35
35
|
|
36
36
|
```shell
|
37
37
|
$ rails g outboxable:install --orm mongoid
|
@@ -82,7 +82,7 @@ Outboxable.configure do |config|
|
|
82
82
|
config.rabbitmq_user = ENV.fetch('RABBITMQ__USERNAME')
|
83
83
|
config.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD')
|
84
84
|
config.rabbitmq_vhost = ENV.fetch('RABBITMQ__VHOST')
|
85
|
-
config.
|
85
|
+
config.rabbitmq_exchange_name = ENV.fetch('RABBITMQ__EXCHANGE_NAME')
|
86
86
|
end
|
87
87
|
```
|
88
88
|
|
@@ -5,8 +5,8 @@ module Outboxable
|
|
5
5
|
source_root File.expand_path('../../templates', __dir__)
|
6
6
|
class_option :orm, type: :string, default: 'activerecord'
|
7
7
|
|
8
|
-
def initialize
|
9
|
-
super
|
8
|
+
def initialize
|
9
|
+
super
|
10
10
|
|
11
11
|
@orm = options[:orm] || 'activerecord'
|
12
12
|
%w[activerecord mongoid].include?(@orm) || raise(ArgumentError, 'Invalid ORM. Only ActiveRecord and Mongoid are supported.')
|
data/lib/outboxable/version.rb
CHANGED
data/lib/outboxable.rb
CHANGED
@@ -32,5 +32,5 @@ Outboxable.configure do |config|
|
|
32
32
|
config.rabbitmq_user = ENV.fetch('RABBITMQ__USERNAME')
|
33
33
|
config.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD')
|
34
34
|
config.rabbitmq_vhost = ENV.fetch('RABBITMQ__VHOST')
|
35
|
-
config.
|
35
|
+
config.rabbitmq_exchange_name = ENV.fetch('RABBITMQ__EXCHANGE_NAME')
|
36
36
|
end
|
@@ -4,7 +4,7 @@ class Outbox < ApplicationRecord
|
|
4
4
|
before_save :check_publishing
|
5
5
|
# Callbacks
|
6
6
|
before_create :set_last_attempted_at
|
7
|
-
|
7
|
+
after_commit :publish, if: :allow_publish?
|
8
8
|
# Enums
|
9
9
|
enum status: { pending: 0, processing: 1, published: 2, failed: 3 }
|
10
10
|
enum size: { single: 0, batch: 1 }
|
@@ -20,8 +20,12 @@ class Outbox < ApplicationRecord
|
|
20
20
|
end
|
21
21
|
|
22
22
|
def publish
|
23
|
-
|
24
|
-
|
23
|
+
# Run this in own thread
|
24
|
+
threaded = Thread.new do
|
25
|
+
Outboxable::Worker.perform_inline(id)
|
26
|
+
update(status: :processing, last_attempted_at: 1.minute.from_now, allow_publish: false)
|
27
|
+
end
|
28
|
+
threaded.join
|
25
29
|
end
|
26
30
|
|
27
31
|
def check_publishing
|
@@ -32,5 +32,5 @@ Outboxable.configure do |config|
|
|
32
32
|
config.rabbitmq_user = ENV.fetch('RABBITMQ__USERNAME')
|
33
33
|
config.rabbitmq_password = ENV.fetch('RABBITMQ__PASSWORD')
|
34
34
|
config.rabbitmq_vhost = ENV.fetch('RABBITMQ__VHOST')
|
35
|
-
config.
|
35
|
+
config.rabbitmq_exchange_name = ENV.fetch('RABBITMQ__EXCHANGE_NAME')
|
36
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: outboxable
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brusk Awat
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bunny
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.22'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.
|
26
|
+
version: '2.22'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: connection_pool
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: '2.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: '2.4'
|
41
41
|
description: The Outboxable Gem is tailored for Rails applications to implement the
|
42
42
|
transactional outbox pattern. It currently only supports ActiveRecord.
|
43
43
|
email:
|
@@ -94,7 +94,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
94
94
|
- !ruby/object:Gem::Version
|
95
95
|
version: '0'
|
96
96
|
requirements: []
|
97
|
-
rubygems_version: 3.4.
|
97
|
+
rubygems_version: 3.4.19
|
98
98
|
signing_key:
|
99
99
|
specification_version: 4
|
100
100
|
summary: An opiniated Gem for Rails applications to implement the transactional outbox
|