active_publisher 1.2.4-java → 1.2.5-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
2
  SHA256:
3
- metadata.gz: 9716e4719f25f9859f126740053aa8876da44015057ef541c6473a1999ce3be9
4
- data.tar.gz: 05a592d671869f9aaa39b127692454c6c95a5cc53d8cfeac4b7cce34cc42c231
3
+ metadata.gz: 7a878924c71e32c34435e80052a8f241b357d2f7b70f3582f7b8920b942e63c0
4
+ data.tar.gz: 60b4eb97d20e389ce4865ef393d69a7d49bdac2e47a3aa26eb6e7ca32e459335
5
5
  SHA512:
6
- metadata.gz: 7756e073e9213f7a900837748c8753863ff4802ecb673190a952f38a90347bde3c1bd158df9644dca1c15eb9333495388835cee8f93cdf7f92dabe93cfad2c63
7
- data.tar.gz: 9bcb7dacca3a4479f6d0dfb5b5573435ea40723477b7ce26ca83198c98d43de978512de5ee4209ae062d1d1759fee49b4bddac953792b68df836f7691e090e49
6
+ metadata.gz: 8f6399701888401993164b31ccb4fff4f14eb13414a7586d7baacac0c49f2c876dfe33035ce091ec4b62ee4a5b64ad961a7deab79691098401388153404c724b
7
+ data.tar.gz: 2a1d1347293457b9e5b663d7f4815a176e8d9afdc80e472893c4f1f5206bdfc057bfb6d692067924727aac1e3a6f42bc2fff20cd13698bca12be61e1b72d84bc
@@ -52,8 +52,8 @@ module ActivePublisher
52
52
  end
53
53
 
54
54
  def cleanup_up_channel
55
- return if @channel.nil?
56
- @channel.close
55
+ return if channel.nil?
56
+ channel.close
57
57
  rescue => error
58
58
  ::ActivePublisher.configuration.error_handler.call(error, {:status => "Cleaning up the channel"})
59
59
  end
@@ -89,7 +89,6 @@ module ActivePublisher
89
89
 
90
90
  def start_thread
91
91
  return if alive?
92
- @channel = make_channel
93
92
  @thread = ::Thread.new { start_consuming_thread }
94
93
  end
95
94
 
@@ -102,13 +101,15 @@ module ActivePublisher
102
101
  # If the queue is empty, we should continue to update to "last_tick_at" time.
103
102
  next if current_messages.nil?
104
103
 
104
+ @channel ||= make_channel
105
+
105
106
  # We only look at active publisher messages. Everything else is dropped.
106
107
  current_messages.select! { |message| message.is_a?(::ActivePublisher::Message) }
107
108
 
108
109
  begin
109
110
  # Only open a single connection for each group of messages to an exchange
110
111
  current_messages.group_by(&:exchange_name).each do |exchange_name, messages|
111
- publish_all(@channel, exchange_name, messages)
112
+ publish_all(exchange_name, messages)
112
113
  current_messages -= messages
113
114
  end
114
115
  rescue *CHANNEL_CLOSED_ERRORS
@@ -135,7 +136,7 @@ module ActivePublisher
135
136
  cleanup_up_channel
136
137
  end
137
138
 
138
- def publish_all(channel, exchange_name, messages)
139
+ def publish_all(exchange_name, messages)
139
140
  exchange = channel.topic(exchange_name)
140
141
  messages.each do |message|
141
142
  fail ::ActivePublisher::ExchangeMismatchError, "bulk publish messages must match publish_all exchange_name" if message.exchange_name != exchange_name
@@ -144,10 +145,10 @@ module ActivePublisher
144
145
  exchange.publish(message.payload, options)
145
146
  end
146
147
  end
147
- wait_for_confirms(channel)
148
+ wait_for_confirms
148
149
  end
149
150
 
150
- def wait_for_confirms(channel)
151
+ def wait_for_confirms
151
152
  return true unless channel.using_publisher_confirms?
152
153
  channel.wait_for_confirms(::ActivePublisher.configuration.publisher_confirms_timeout)
153
154
  end
@@ -1,3 +1,3 @@
1
1
  module ActivePublisher
2
- VERSION = "1.2.4"
2
+ VERSION = "1.2.5"
3
3
  end
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.2.4
4
+ version: 1.2.5
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: 2020-11-20 00:00:00.000000000 Z
15
+ date: 2020-11-23 00:00:00.000000000 Z
16
16
  dependencies:
17
17
  - !ruby/object:Gem::Dependency
18
18
  requirement: !ruby/object:Gem::Requirement