strum-esb 0.3.2 → 0.3.3

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: 69e8c8f83ea8fb64fcb508db9fb496cf22f923f72a623406a38c7c438bbf5386
4
- data.tar.gz: 042dccb57a2456cd9be6a24a0a11b18f2db9d3bd604c4e7bac1e063081561314
3
+ metadata.gz: 5eed53438b480b0f9f2faae4b2662dfb7005441bd74f62b15986d4eefeefbe7e
4
+ data.tar.gz: c8f52bbfc3955ca0735d1536e99fc07238ef6a823b84e602a242fad9b690646c
5
5
  SHA512:
6
- metadata.gz: 393401ad3d93137645c07bcec428b9d9525c3fa0fd1348ea913a67a7b2d905954346e9d52320fc600fc13854166b8c54d0ab67d778770c3b87c7c7245177d30f
7
- data.tar.gz: 01b6c5776818e72eb589e5f380a869ddea897248447659e595af76d2342c4bdc2a76ef1b6a6cc5e58851122f63240ed4bbaa430aeadbc13bf731408c6df9b089
6
+ metadata.gz: c4eb4852df47c231e43218243178582e860f3dc553b06f5f8f32165b27c4a7d2448f01ac690b59617b4e724927db4224b9311791df77a8aff3a70ada43b3f9a0
7
+ data.tar.gz: c0a6ce6875f528459031905df09bdcccc1cc1fa34e6ed6eecfa5863647b8d711b38879f8c13afb1ff915c7ce642a92637bfc7bc559df40921cd30761baab2c53
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
  # Changelog
3
3
  All notable changes to this project will be documented in this file.
4
4
 
5
+ ## [0.3.3]
6
+ ### Added
7
+ - default content type `application/json` in handler by [@valeriia.kolisnyk]
8
+
5
9
  ## [0.3.2]
6
10
  ### Added
7
11
  - autoremove thread variables before handle message (used by pipeline storage)
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- strum-esb (0.3.2)
4
+ strum-esb (0.3.3)
5
5
  bunny (~> 2.15)
6
6
  connection_pool (~> 2.2.2)
7
7
  dry-configurable (~> 0.12.1)
@@ -29,7 +29,7 @@ GEM
29
29
  dry-core (0.7.1)
30
30
  concurrent-ruby (~> 1.0)
31
31
  dry-inflector (0.2.1)
32
- json (2.6.1)
32
+ json (2.6.2)
33
33
  parallel (1.22.1)
34
34
  parser (3.1.1.0)
35
35
  ast (~> 2.4.1)
@@ -55,7 +55,7 @@ module Strum
55
55
  def work_with_params(deserialized_msg, delivery_info, metadata)
56
56
  Strum::Esb.config.before_handler_hooks.each { |hook| hook.call(deserialized_msg, delivery_info, metadata) }
57
57
 
58
- action = header(metadata, "action")
58
+ action = header(metadata, "action")
59
59
  resource = header(metadata, "resource")
60
60
  event = header(metadata, "event")
61
61
  state = header(metadata, "state")
@@ -78,20 +78,22 @@ module Strum
78
78
 
79
79
  method_name = ([*methods_names] << "handler").find { |n| respond_to?(n, include_all: true) }
80
80
 
81
- unless Strum::Esb.config.serializer.enabled?(metadata[:content_type])
82
- logger.error "Content type #{metadata[:content_type]} is disabled by handler. Message rejected #{metadata[:headers]} with payload #{deserialized_msg}"
81
+ unless method_name
82
+ logger.error "Handler not found. Message rejected #{metadata[:headers]} with payload #{deserialized_msg}"
83
83
  return reject!
84
84
  end
85
85
 
86
- payload, valid_payload = Strum::Esb.config.serializer.deserialize(deserialized_msg, metadata[:content_type], method_name)
86
+ content_type = metadata[:content_type] || "application/json"
87
87
 
88
- unless valid_payload
89
- logger.error "Content type is invalid. Message rejected #{metadata[:headers]} with payload #{payload}"
88
+ unless Strum::Esb.config.serializer.enabled?(content_type)
89
+ logger.error "Content type #{content_type} is disabled by handler. Message rejected #{metadata[:headers]} with payload #{deserialized_msg}"
90
90
  return reject!
91
91
  end
92
92
 
93
- unless method_name
94
- logger.error "Handler not found. Message rejected #{metadata[:headers]} with payload #{payload}"
93
+ payload, valid_payload = Strum::Esb.config.serializer.deserialize(deserialized_msg, content_type, method_name)
94
+
95
+ unless valid_payload
96
+ logger.error "Payload was unable to be parsed with #{content_type} content type. Message rejected #{metadata[:headers]} with payload #{payload}"
95
97
  return reject!
96
98
  end
97
99
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Strum
4
4
  module Esb
5
- VERSION = "0.3.2"
5
+ VERSION = "0.3.3"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: strum-esb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.2
4
+ version: 0.3.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Serhiy Nazarov
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-03-28 00:00:00.000000000 Z
11
+ date: 2022-07-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bunny