active_publisher 1.0.0.pre2-java → 1.0.0.pre3-java
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 +5 -5
- data/.travis.yml +0 -2
- data/active_publisher.gemspec +1 -0
- data/lib/active_publisher/async/in_memory_adapter/async_queue.rb +9 -2
- data/lib/active_publisher/version.rb +1 -1
- data/lib/active_publisher.rb +7 -2
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: ccc19c39b6f46e071b2963f01001593d54bc8793
|
4
|
+
data.tar.gz: ffffe4bd025d4a653b68a5880303e13890a8ab4b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9a31296f4d4970603402030b14a2db58a46ef4410669cacca9ff2721733c0ea0830fd56149019ad93f0b9e52c506be2fc678e2f4211d098cba8ee8f8a794ac99
|
7
|
+
data.tar.gz: 1718c914cd52f075a7259571a88aa354c82bbd462c2e04b7bd8d12c0bf0a5b0187520e3fba2927fd6e41b0bdb9efd27a9f580e1c620d66a7c4beefe24dc668e8
|
data/.travis.yml
CHANGED
data/active_publisher.gemspec
CHANGED
@@ -33,12 +33,16 @@ module ActivePublisher
|
|
33
33
|
if queue.size >= max_queue_size
|
34
34
|
case back_pressure_strategy
|
35
35
|
when :drop
|
36
|
+
::ActiveSupport::Notifications.instrument "message_dropped.active_publisher"
|
36
37
|
return
|
37
38
|
when :raise
|
39
|
+
::ActiveSupport::Notifications.instrument "message_dropped.active_publisher"
|
38
40
|
fail ::ActivePublisher::Async::InMemoryAdapter::UnableToPersistMessageError, "Queue is full, messages will be dropped."
|
39
41
|
when :wait
|
40
|
-
|
41
|
-
|
42
|
+
::ActiveSupport::Notifications.instrument "wait_for_async_queue.active_publisher" do
|
43
|
+
# This is a really crappy way to wait
|
44
|
+
sleep 0.01 until queue.size < max_queue_size
|
45
|
+
end
|
42
46
|
end
|
43
47
|
end
|
44
48
|
|
@@ -63,6 +67,9 @@ module ActivePublisher
|
|
63
67
|
@consumer = ::ActivePublisher::Async::InMemoryAdapter::ConsumerThread.new(queue)
|
64
68
|
end
|
65
69
|
|
70
|
+
# Notify the current queue size.
|
71
|
+
::ActiveSupport::Notifications.instrument "async_queue_size.active_publisher", queue.size
|
72
|
+
|
66
73
|
# Pause before checking the consumer again.
|
67
74
|
sleep supervisor_interval
|
68
75
|
end
|
data/lib/active_publisher.rb
CHANGED
@@ -3,6 +3,7 @@ if ::RUBY_PLATFORM == "java"
|
|
3
3
|
else
|
4
4
|
require "bunny"
|
5
5
|
end
|
6
|
+
require "active_support"
|
6
7
|
require "thread"
|
7
8
|
|
8
9
|
require "active_publisher/logging"
|
@@ -34,7 +35,9 @@ module ActivePublisher
|
|
34
35
|
# @param [Hash] options hash to set message parameters (e.g. headers)
|
35
36
|
def self.publish(route, payload, exchange_name, options = {})
|
36
37
|
with_exchange(exchange_name) do |exchange|
|
37
|
-
|
38
|
+
::ActiveSupport::Notifications.instrument "message_published.active_publisher" do
|
39
|
+
exchange.publish(payload, publishing_options(route, options))
|
40
|
+
end
|
38
41
|
end
|
39
42
|
end
|
40
43
|
|
@@ -48,7 +51,9 @@ module ActivePublisher
|
|
48
51
|
fail ActivePublisher::ExchangeMismatchError, "bulk publish messages must match publish_all exchange_name" if message.exchange_name != exchange_name
|
49
52
|
|
50
53
|
begin
|
51
|
-
|
54
|
+
::ActiveSupport::Notifications.instrument "message_published.active_publisher" do
|
55
|
+
exchange.publish(message.payload, publishing_options(message.route, message.options || {}))
|
56
|
+
end
|
52
57
|
rescue
|
53
58
|
messages << message
|
54
59
|
raise
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: active_publisher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.pre3
|
5
5
|
platform: java
|
6
6
|
authors:
|
7
7
|
- Brian Stien
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: exe
|
14
14
|
cert_chain: []
|
15
|
-
date: 2017-
|
15
|
+
date: 2017-09-01 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
requirement: !ruby/object:Gem::Requirement
|
@@ -28,6 +28,20 @@ dependencies:
|
|
28
28
|
- - "~>"
|
29
29
|
- !ruby/object:Gem::Version
|
30
30
|
version: '2.7'
|
31
|
+
- !ruby/object:Gem::Dependency
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
33
|
+
requirements:
|
34
|
+
- - ">="
|
35
|
+
- !ruby/object:Gem::Version
|
36
|
+
version: '3.2'
|
37
|
+
name: activesupport
|
38
|
+
prerelease: false
|
39
|
+
type: :runtime
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
version: '3.2'
|
31
45
|
- !ruby/object:Gem::Dependency
|
32
46
|
requirement: !ruby/object:Gem::Requirement
|
33
47
|
requirements:
|
@@ -150,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
164
|
version: 1.3.1
|
151
165
|
requirements: []
|
152
166
|
rubyforge_project:
|
153
|
-
rubygems_version: 2.6.
|
167
|
+
rubygems_version: 2.6.13
|
154
168
|
signing_key:
|
155
169
|
specification_version: 4
|
156
170
|
summary: Aims to make publishing work across MRI and jRuby painless and add some nice
|