google-pubsub-enhancer 0.4.0 → 0.4.1

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
  SHA1:
3
- metadata.gz: 403d0c89b7e9e6938283cdd7e955af7c94995bd8
4
- data.tar.gz: 45a6176699295b29e249bad298726c9b60dbee2c
3
+ metadata.gz: 9c24a1692b79fc980b6a1c4b7d400ceae6fa29a2
4
+ data.tar.gz: acf5bae2cf05a35b8bed3fd0284e901c8b962e05
5
5
  SHA512:
6
- metadata.gz: 5df9d3e5deb2539b1edbec674cfc06d12991ee525c40262a13e16825bc67c747be600ef4ff42b5c8ca168cc24b99603f6055ab3a2725c2c6d4793b99838aabd0
7
- data.tar.gz: a3b1dff3d50b3fed07a069d457d00b72704394fb0ffa6fffa9345419aa93f877e48b6ee1938fea3b09ef874f75602eb80a93fb41f62a31cfb9b9eda6aa2cf801
6
+ metadata.gz: 0569fe92aecf7244ea9e5a78ab5a9987e01c651d354e38ffbd8ddfdf6222ede4cfc1b74fc32c4dd55cfb824bd5b282769e99266c54653e3c1667993e49ecd1f8
7
+ data.tar.gz: aaaeda31795661b22989279bab17a0f1bde16fe96da67e66cec815398ace6f5d10d762e5559d8fc979a180ad08d79a602682c0ace974fc32306890e1195282a5
@@ -43,6 +43,7 @@ class GooglePubsubEnhancer
43
43
  while received_messages = subscription.pull(:max => GooglePubsubEnhancer::Constants::MAX_PULL_SIZE)
44
44
  break if opts[:shutdown].call || received_messages == nil
45
45
  next if received_messages.empty?
46
+ @logger.debug{"#{received_messages.length} messages received"}
46
47
  @stack.call({received_messages: received_messages})
47
48
  subscription.acknowledge(received_messages)
48
49
  end
@@ -5,10 +5,12 @@ class GooglePubsubEnhancer::Middleware::Publisher
5
5
  @short_topic_name = opts[:short_topic_name] || raise
6
6
  @full_topic_name = GooglePubsubEnhancer.name_by('topics',@short_topic_name)
7
7
  @messages_key = opts[:messages] || raise
8
+ @logger = opts[:logger] || Logger.new(STDOUT)
8
9
  @google_cloud_pubsub ||= Google::Cloud::Pubsub.new
9
10
  end
10
11
 
11
12
  def call(env)
13
+ @logger.debug("#{env[@messages_key].length} messages published")
12
14
  @google_cloud_pubsub.publish(@full_topic_name) do |publisher|
13
15
  [*env[@messages_key]].each do |m|
14
16
  publisher.publish(m)
@@ -1,3 +1,3 @@
1
1
  class GooglePubsubEnhancer
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: google-pubsub-enhancer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - bejczib