bug_bunny 0.2.4 → 0.2.5

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f841d7999ff2bf99c3e9d019b5ccfdb7ba0d6263d48adea655175cdc3b39569
4
- data.tar.gz: 2729e4af16616823950a1aaf5e49206c77c95567049c3f5dd956b347ef90b7ab
3
+ metadata.gz: f97718fff3161c0caa40bac2d6b5caa6e4116a9c2aa7b5b28ff914204def6620
4
+ data.tar.gz: 25ed25993112d98da6bb1746e171f22ffafb2cd0d704459be951ff5acfe0dd73
5
5
  SHA512:
6
- metadata.gz: fe5a26882d6515bb1731cc3aa3f38446c7cdbc09698cb9091cc0a8b4125ec2939e41d05cd27b4293f74f00405c027a98a01fc3c7db8c9737b762fee97a4653c2
7
- data.tar.gz: 1653165f74ef1e4e22e0bb75500a6aa5d8f17cc2879e2d08945f43366072f552fb8babe579c28d393f0f94e9db774e7b65399178893fd86ce5d878fc35a0cace
6
+ metadata.gz: 5f9cc8c2591083ddad646c832faaeada4bda39734522fea45a1ade1115ef37a8d79a536e7a1dc743b4f6d29fe8f8f3a88a8fddae2dd902a6c439de28adca942d
7
+ data.tar.gz: a2f7b56c4fddb35f023fe3eb2d42b22b00cf8206b0f5201f3c9ae2927c29243ce46ea89ff3afab9d2f8b37797831edab73405470e1426a35a39bf05b8cf7fc1b
@@ -21,7 +21,7 @@ module BugBunny
21
21
 
22
22
  def initialize(attrs = {})
23
23
  @logger = Logger.new('./log/bug_bunny.log', 'monthly')
24
- @communication_response = ::BugBunny::Message.new(status: :error)
24
+ @communication_response = ::BugBunny::Response.new status: false
25
25
  @time_to_wait = 2
26
26
  create_adapter_with_rabbit
27
27
  end
@@ -29,7 +29,7 @@ module BugBunny
29
29
  def publish!(message, publish_queue, opts = {})
30
30
  Timeout::timeout(TIMEOUT) do
31
31
  if opts[:check_consumers_count] && publish_queue.check_consumers.zero?
32
- self.communication_response = ::BugBunny::Message.new(status: :error, body: CONSUMER_COUNT_ZERO)
32
+ self.communication_response = ::BugBunny::Response.new(status: false, response: CONSUMER_COUNT_ZERO)
33
33
  return
34
34
  end
35
35
 
@@ -51,16 +51,16 @@ module BugBunny
51
51
  rabbit.exchange.publish(message.to_json, publish_opts)
52
52
  rabbit.channel.wait_for_confirms if rabbit.confirm_select
53
53
 
54
- self.communication_response = ::BugBunny::Message.new(status: true)
54
+ self.communication_response = ::BugBunny::Response.new(status: true)
55
55
  end
56
56
  rescue Timeout::Error => e
57
57
  logger.error(e)
58
58
  close_connection!
59
- self.communication_response = ::BugBunny::Message.new(status: :error, body: PUBLISH_TIMEOUT, exception: e)
59
+ self.communication_response = ::BugBunny::Response.new(status: false, response: PUBLISH_TIMEOUT, exception: e)
60
60
  rescue StandardError => e
61
61
  logger.error(e)
62
62
  close_connection!
63
- self.communication_response = ::BugBunny::Message.new(status: :error, body: BOMBA, exception: e)
63
+ self.communication_response = ::BugBunny::Response.new(status: false, response: BOMBA, exception: e)
64
64
  end
65
65
 
66
66
  def consume!(queue, thread: false, manual_ack: true, exclusive: false, block: true, opts: {})
@@ -124,7 +124,7 @@ module BugBunny
124
124
  end
125
125
 
126
126
  self.service_message = message
127
- self.communication_response = ::BugBunny::Message.new(status: :success)
127
+ self.communication_response = ::BugBunny::Response.new(status: true)
128
128
  rescue ::SystemExit => e # Ensure exit code
129
129
  raise e
130
130
  rescue => e
@@ -134,7 +134,7 @@ module BugBunny
134
134
  close_connection!
135
135
 
136
136
  # Session.clean!
137
- self.communication_response = ::BugBunny::Message.new(status: :error, body: BOMBA, exception: e)
137
+ self.communication_response = ::BugBunny::Response.new(status: false, response: BOMBA, exception: e)
138
138
  end
139
139
 
140
140
  if thread # sync consumer flag :D
@@ -190,12 +190,12 @@ module BugBunny
190
190
  logger.debug("Rabbit Identifier: #{rabbit.try(:identifier)}")
191
191
  logger.error(e)
192
192
  close_connection!
193
- ::BugBunny::Message.new(status: :error, body: CONSUMER_TIMEOUT, exception: e)
193
+ ::BugBunny::Response.new(status: false, response: CONSUMER_TIMEOUT, exception: e)
194
194
  rescue StandardError => e
195
195
  logger.debug("Rabbit Identifier: #{rabbit.try(:identifier)}")
196
196
  logger.error(e)
197
197
  close_connection!
198
- ::BugBunny::Message.new(status: :error, body: BOMBA, exception: e)
198
+ ::BugBunny::Response.new(status: false, response: BOMBA, exception: e)
199
199
  end
200
200
 
201
201
  def publish_and_consume!(publish_message, sync_queue, opts={})
@@ -1,6 +1,5 @@
1
1
  module BugBunny
2
2
  class Exception
3
-
4
3
  class ServiceError < StandardError
5
4
  def to_s
6
5
  :service_error
@@ -37,6 +36,15 @@ module BugBunny
37
36
  end
38
37
  end
39
38
 
39
+ class WithOutConsumer < StandardError
40
+ attr_accessor :backtrace
41
+
42
+ def initialize(msg, backtrace)
43
+ @backtrace = backtrace
44
+ super(msg)
45
+ end
46
+ end
47
+
40
48
  class RetryWithoutError < StandardError
41
49
  def to_s
42
50
  "retry_sidekiq_without_error"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module BugBunny
4
- VERSION = "0.2.4"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bug_bunny
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - gabix
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-30 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: bunny
@@ -68,7 +67,6 @@ metadata:
68
67
  homepage_uri: https://github.com/gedera/bug_bunny
69
68
  source_code_uri: https://github.com/gedera/bug_bunny
70
69
  changelog_uri: https://github.com/gedera/bug_bunny/blob/main/CHANGELOG.md
71
- post_install_message:
72
70
  rdoc_options: []
73
71
  require_paths:
74
72
  - lib
@@ -83,8 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
81
  - !ruby/object:Gem::Version
84
82
  version: '0'
85
83
  requirements: []
86
- rubygems_version: 3.4.1
87
- signing_key:
84
+ rubygems_version: 3.6.9
88
85
  specification_version: 4
89
86
  summary: Gem for sync and async comunication via rabbit bunny.
90
87
  test_files: []