active_publisher 1.0.0.pre2-java → 1.0.0.pre3-java

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA256:
3
- metadata.gz: 6aa12277baa756954e11368840abbd437d5e65226a953581a6377a3ae8c6afb7
4
- data.tar.gz: dd01c96fe75e8769d0252443a10d7e3bb64f6f62485ea8c650c4c29cd53c246f
2
+ SHA1:
3
+ metadata.gz: ccc19c39b6f46e071b2963f01001593d54bc8793
4
+ data.tar.gz: ffffe4bd025d4a653b68a5880303e13890a8ab4b
5
5
  SHA512:
6
- metadata.gz: 3d40019b346f89631b84a79da118c5e541e73904722c76d35bfd5d81b3feef1efcd4ab40351b47e18ec0c6b06f85b713e5db67eeb87f1a993c831d1b86ea9812
7
- data.tar.gz: f7ccf8180d8806103ae680b1d2f4af9416794c16f75bb2afef6212113388be302d762c1152568594f09d1539b999b030b05d852771d44edbb97126415ccdfc99
6
+ metadata.gz: 9a31296f4d4970603402030b14a2db58a46ef4410669cacca9ff2721733c0ea0830fd56149019ad93f0b9e52c506be2fc678e2f4211d098cba8ee8f8a794ac99
7
+ data.tar.gz: 1718c914cd52f075a7259571a88aa354c82bbd462c2e04b7bd8d12c0bf0a5b0187520e3fba2927fd6e41b0bdb9efd27a9f580e1c620d66a7c4beefe24dc668e8
data/.travis.yml CHANGED
@@ -1,9 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.2
4
3
  - 2.3
5
4
  - 2.4
6
- - jruby-1.7
7
5
  - jruby-9.1.12.0
8
6
  services:
9
7
  - rabbitmq
@@ -26,6 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.add_dependency 'bunny', '~> 2.1'
27
27
  end
28
28
 
29
+ spec.add_dependency 'activesupport', '>= 3.2'
29
30
  spec.add_dependency 'multi_op_queue', '>= 0.1.2'
30
31
 
31
32
  spec.add_development_dependency "bundler"
@@ -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
- # This is a really crappy way to wait
41
- sleep 0.01 until queue.size < max_queue_size
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
@@ -1,3 +1,3 @@
1
1
  module ActivePublisher
2
- VERSION = "1.0.0.pre2"
2
+ VERSION = "1.0.0.pre3"
3
3
  end
@@ -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
- exchange.publish(payload, publishing_options(route, options))
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
- exchange.publish(message.payload, publishing_options(message.route, message.options || {}))
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.pre2
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-08-29 00:00:00.000000000 Z
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.11
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