eventhub-processor2 1.4.1 → 1.10.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +1 -0
- data/.ruby-version +1 -0
- data/.travis.yml +5 -4
- data/CHANGELOG.md +26 -0
- data/Gemfile +1 -1
- data/Gemfile.lock +64 -52
- data/README.md +13 -2
- data/Rakefile +13 -4
- data/docker/Dockerfile +5 -3
- data/docker/README.md +2 -2
- data/docker/definitions.json +44 -1
- data/docker/docker-compose.yml +11 -0
- data/docker/reset +5 -0
- data/eventhub-processor2.gemspec +24 -23
- data/example/crasher.rb +12 -13
- data/example/publisher.rb +41 -41
- data/example/receiver.rb +2 -2
- data/example/router.rb +3 -3
- data/lib/eventhub/actor_heartbeat.rb +22 -23
- data/lib/eventhub/actor_listener.rb +18 -23
- data/lib/eventhub/actor_publisher.rb +7 -7
- data/lib/eventhub/actor_watchdog.rb +3 -4
- data/lib/eventhub/base.rb +24 -31
- data/lib/eventhub/base_exception.rb +2 -2
- data/lib/eventhub/configuration.rb +31 -26
- data/lib/eventhub/constant.rb +24 -24
- data/lib/eventhub/hash_extensions.rb +8 -8
- data/lib/eventhub/helper.rb +7 -7
- data/lib/eventhub/logger.rb +2 -2
- data/lib/eventhub/message.rb +45 -45
- data/lib/eventhub/processor2.rb +22 -22
- data/lib/eventhub/sleeper.rb +1 -1
- data/lib/eventhub/statistics.rb +6 -9
- data/lib/eventhub/version.rb +1 -1
- metadata +35 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: bf33bf376e804fd54bc99b3a538c6ce148325d3954344d5ca6fa853b1621ffd7
|
4
|
+
data.tar.gz: 60083e2300ae7d0bf41ca09cb6efafe2665561d323089b58aa342c69412c0d49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 66f88f2c77e2bbd6140ddc02d95c59af8045804ca10262b367cafd13de12045c28b341bc3655d31f6c9d78fbb990c4e63d7265db50def7075f15b90122d27d8c
|
7
|
+
data.tar.gz: 6133d08b08b596fc95e657fbb6e81ebdfa2c2ee52d2064f83a214a2e84b4acf428e20f7d99e7ec930a9e2e4fd72bbea0d8e6e5184202bd482c926be989162c72
|
data/.rspec
CHANGED
data/.ruby-version
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
2.6.6
|
data/.travis.yml
CHANGED
@@ -9,9 +9,10 @@ os:
|
|
9
9
|
- linux
|
10
10
|
|
11
11
|
rvm:
|
12
|
-
-
|
13
|
-
- 2.
|
14
|
-
- 2.
|
12
|
+
- 3.0.0
|
13
|
+
- 2.7.2
|
14
|
+
- 2.6.6
|
15
|
+
- 2.5.8
|
15
16
|
|
16
17
|
env:
|
17
18
|
- secure: R0rBtWClmnJKO+zyAncF6+1qDpZ6JQR+Z6VXzUmWw8MuxUXv732XTNYulY/tTeDW876GofAsOF9QfX/jhF+2ubV8SzM6rKTZS09feATuOWRPtECEaBOPcb0JGYouBNg/Lv4onuXb8KS/9U093sRqiJMfib82iY7QK9bnDPsYoQXtMnI7KBeQNrTV0H4nby3lvbjcpMDhmyg+anOmCP5yepZeS53Qq+C5GHguYivisvhSPmCfONrT303XxFLDo/aOkMDlceeZBDhtcpm5Px3GIwybSI9xRtAnpT73oL1Piazda6mRN7VHoT7YAHKqcJNZDB48HYuTj3Pt3oVVw0v78Cf25caBqXttXflXfB8U3qfVt+94uF0icH34NAnpW9l1B8GXHi6CTr27Hg2ZatWkQCN1rCpcCaW0eM/NoAG6snwTIwr1VvjLWpSW5wwhQgHPyMl+MRlTmCn/UM+eQSwPVhflKpMS1+ah6cbhDrQQF1jDt3dRaLqSnVE4APrafdT90SA3SCG2MGOE+pp+DX528gEsRB34UdX2V67dlwXeRu1eU5vZBR7jZrqwuwTAgSvxEF0eJWC0kgvEfouzuVHhVmmSAcNNHlg2kd0/oyQELyXTsklJghwAupcy4X/GEAyfLW9GAxItjATyV7XyfjmaBmdzHl/5JWeXicoyZ/4+8iE=
|
@@ -23,7 +24,7 @@ before_install:
|
|
23
24
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64
|
24
25
|
> ./cc-test-reporter
|
25
26
|
- chmod +x ./cc-test-reporter
|
26
|
-
- gem install bundler --version '~> 1.
|
27
|
+
- gem install bundler --version '~> 2.1.2'
|
27
28
|
|
28
29
|
before_script:
|
29
30
|
- "./cc-test-reporter before-build"
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,31 @@
|
|
1
1
|
# Changelog of EventHub::Processor2
|
2
2
|
|
3
|
+
## 1.9.0 / 2021-02-26
|
4
|
+
|
5
|
+
* Updated gem dependencies
|
6
|
+
* Appply ruby style guides
|
7
|
+
* Reduce log noice
|
8
|
+
|
9
|
+
## 1.8.0 / 2020-05-05
|
10
|
+
|
11
|
+
* Increase watchdog cycle time to 60s
|
12
|
+
* Upgrade gem and gem dev dependencies
|
13
|
+
* Upgrade travis ruby version to test
|
14
|
+
|
15
|
+
## 1.7.0 / 2020-02-28
|
16
|
+
|
17
|
+
* Upgrade dependencies: bundler 2.1, rake 13.0, rspec 3.9, simplecov 0.18
|
18
|
+
* status_message always as string for general exception handling
|
19
|
+
* fix rspec tests
|
20
|
+
|
21
|
+
## 1.6.0 / 2019-02-20
|
22
|
+
|
23
|
+
* Upgrade dependencies: bunny 2.14, bundler 2.0
|
24
|
+
|
25
|
+
## 1.5.0 / 2018-12-20
|
26
|
+
|
27
|
+
* Upgrade dependencies: rspec 3.8, bunny 2.12, bundler 1.17, simplecov 0.16
|
28
|
+
|
3
29
|
## 1.4.1 / 2018-02-27
|
4
30
|
|
5
31
|
* Upgrade to eventhub-components 0.2.2
|
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,76 +1,88 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
eventhub-processor2 (1.
|
5
|
-
bunny (~> 2.
|
6
|
-
celluloid (~> 0.
|
4
|
+
eventhub-processor2 (1.10.0)
|
5
|
+
bunny (~> 2.15)
|
6
|
+
celluloid (~> 0.18)
|
7
7
|
eventhub-components (~> 0.2)
|
8
8
|
uuidtools (~> 2.1)
|
9
9
|
|
10
10
|
GEM
|
11
11
|
remote: https://rubygems.org/
|
12
12
|
specs:
|
13
|
-
amq-protocol (2.3.
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
celluloid-supervision
|
22
|
-
timers (>= 4.1.1)
|
23
|
-
celluloid-essentials (0.20.5)
|
24
|
-
timers (>= 4.1.1)
|
25
|
-
celluloid-extras (0.20.5)
|
26
|
-
timers (>= 4.1.1)
|
27
|
-
celluloid-fsm (0.20.5)
|
28
|
-
timers (>= 4.1.1)
|
29
|
-
celluloid-pool (0.20.5)
|
30
|
-
timers (>= 4.1.1)
|
31
|
-
celluloid-supervision (0.20.6)
|
32
|
-
timers (>= 4.1.1)
|
33
|
-
diff-lcs (1.3)
|
34
|
-
docile (1.1.5)
|
13
|
+
amq-protocol (2.3.2)
|
14
|
+
ast (2.4.2)
|
15
|
+
bunny (2.17.0)
|
16
|
+
amq-protocol (~> 2.3, >= 2.3.1)
|
17
|
+
celluloid (0.18.0)
|
18
|
+
timers (~> 4)
|
19
|
+
diff-lcs (1.4.4)
|
20
|
+
docile (1.3.5)
|
35
21
|
eventhub-components (0.2.2)
|
36
22
|
logstash-logger (~> 0.26)
|
37
|
-
hitimes (1.2.6)
|
38
|
-
json (2.1.0)
|
39
23
|
logstash-event (1.2.02)
|
40
24
|
logstash-logger (0.26.1)
|
41
25
|
logstash-event (~> 1.2)
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
rspec
|
26
|
+
parallel (1.20.1)
|
27
|
+
parser (3.0.0.0)
|
28
|
+
ast (~> 2.4.1)
|
29
|
+
rainbow (3.0.0)
|
30
|
+
rake (13.0.3)
|
31
|
+
regexp_parser (2.0.3)
|
32
|
+
rexml (3.2.4)
|
33
|
+
rspec (3.10.0)
|
34
|
+
rspec-core (~> 3.10.0)
|
35
|
+
rspec-expectations (~> 3.10.0)
|
36
|
+
rspec-mocks (~> 3.10.0)
|
37
|
+
rspec-core (3.10.1)
|
38
|
+
rspec-support (~> 3.10.0)
|
39
|
+
rspec-expectations (3.10.1)
|
50
40
|
diff-lcs (>= 1.2.0, < 2.0)
|
51
|
-
rspec-support (~> 3.
|
52
|
-
rspec-mocks (3.
|
41
|
+
rspec-support (~> 3.10.0)
|
42
|
+
rspec-mocks (3.10.2)
|
53
43
|
diff-lcs (>= 1.2.0, < 2.0)
|
54
|
-
rspec-support (~> 3.
|
55
|
-
rspec-support (3.
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
44
|
+
rspec-support (~> 3.10.0)
|
45
|
+
rspec-support (3.10.2)
|
46
|
+
rubocop (1.10.0)
|
47
|
+
parallel (~> 1.10)
|
48
|
+
parser (>= 3.0.0.0)
|
49
|
+
rainbow (>= 2.2.2, < 4.0)
|
50
|
+
regexp_parser (>= 1.8, < 3.0)
|
51
|
+
rexml
|
52
|
+
rubocop-ast (>= 1.2.0, < 2.0)
|
53
|
+
ruby-progressbar (~> 1.7)
|
54
|
+
unicode-display_width (>= 1.4.0, < 3.0)
|
55
|
+
rubocop-ast (1.4.1)
|
56
|
+
parser (>= 2.7.1.5)
|
57
|
+
rubocop-performance (1.9.2)
|
58
|
+
rubocop (>= 0.90.0, < 2.0)
|
59
|
+
rubocop-ast (>= 0.4.0)
|
60
|
+
ruby-progressbar (1.11.0)
|
61
|
+
simplecov (0.21.2)
|
62
|
+
docile (~> 1.1)
|
63
|
+
simplecov-html (~> 0.11)
|
64
|
+
simplecov_json_formatter (~> 0.1)
|
65
|
+
simplecov-html (0.12.3)
|
66
|
+
simplecov_json_formatter (0.1.2)
|
67
|
+
standard (0.13.0)
|
68
|
+
rubocop (= 1.10.0)
|
69
|
+
rubocop-performance (= 1.9.2)
|
70
|
+
standardrb (1.0.0)
|
71
|
+
standard
|
72
|
+
timers (4.3.3)
|
73
|
+
unicode-display_width (2.0.0)
|
74
|
+
uuidtools (2.2.0)
|
64
75
|
|
65
76
|
PLATFORMS
|
66
77
|
ruby
|
67
78
|
|
68
79
|
DEPENDENCIES
|
69
|
-
bundler (~> 1
|
80
|
+
bundler (~> 2.1)
|
70
81
|
eventhub-processor2!
|
71
|
-
rake (~>
|
72
|
-
rspec (~> 3.
|
73
|
-
simplecov (~> 0.
|
82
|
+
rake (~> 13.0)
|
83
|
+
rspec (~> 3.9)
|
84
|
+
simplecov (~> 0.21)
|
85
|
+
standardrb (~> 1.0)
|
74
86
|
|
75
87
|
BUNDLED WITH
|
76
|
-
1.
|
88
|
+
2.1.4
|
data/README.md
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
[![Gem Version](https://badge.fury.io/rb/eventhub-processor2.svg)](https://badge.fury.io/rb/eventhub-processor2)
|
2
|
-
[![Dependency Status](https://gemnasium.com/badges/github.com/thomis/eventhub-processor2.svg)](https://gemnasium.com/github.com/thomis/eventhub-processor2)
|
3
2
|
[![Maintainability](https://api.codeclimate.com/v1/badges/9112358562f0614e0e02/maintainability)](https://codeclimate.com/github/thomis/eventhub-processor2/maintainability)
|
4
3
|
[![Test Coverage](https://api.codeclimate.com/v1/badges/9112358562f0614e0e02/test_coverage)](https://codeclimate.com/github/thomis/eventhub-processor2/test_coverage)
|
5
4
|
[![Build Status](https://travis-ci.org/thomis/eventhub-processor2.svg?branch=master)](https://travis-ci.org/thomis/eventhub-processor2)
|
@@ -174,7 +173,19 @@ Processor2 symbolizes keys and sub-keys from configuration files automatically.
|
|
174
173
|
|
175
174
|
## Development
|
176
175
|
|
177
|
-
|
176
|
+
```
|
177
|
+
# Get the source code
|
178
|
+
git clone https://github.com/thomis/eventhub-processor2.git
|
179
|
+
|
180
|
+
# Install dependencies
|
181
|
+
bundle
|
182
|
+
|
183
|
+
# Setup rabbitmq docker container with initial definitions. This can be run multiple times to get your container back into an initial state
|
184
|
+
bundle exec rake init
|
185
|
+
|
186
|
+
# Run all rspec tests
|
187
|
+
bundle exec rake
|
188
|
+
```
|
178
189
|
|
179
190
|
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
180
191
|
|
data/Rakefile
CHANGED
@@ -1,6 +1,15 @@
|
|
1
|
-
require
|
2
|
-
require
|
1
|
+
require "bundler/gem_tasks"
|
2
|
+
require "rspec/core/rake_task"
|
3
|
+
require "standard/rake"
|
3
4
|
|
4
|
-
RSpec::Core::RakeTask.new(:spec)
|
5
|
+
RSpec::Core::RakeTask.new(:spec) do |t|
|
6
|
+
t.verbose = false
|
7
|
+
end
|
5
8
|
|
6
|
-
|
9
|
+
desc "Initialize or reset rabbitmq docker container (run before rspec)"
|
10
|
+
task :init do
|
11
|
+
sh "cd docker && ./reset"
|
12
|
+
puts "You may need to give rabbitmq container a bit time to startup properly..."
|
13
|
+
end
|
14
|
+
|
15
|
+
task default: [:spec, :standard]
|
data/docker/Dockerfile
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
FROM rabbitmq:3.
|
1
|
+
FROM rabbitmq:3.8.14-management
|
2
|
+
|
3
|
+
LABEL maintainer="thomas.steiner@ikey.ch"
|
4
|
+
|
2
5
|
ADD definitions.json /etc/rabbitmq/
|
3
6
|
ADD rabbitmq.config /etc/rabbitmq/
|
4
7
|
RUN chown rabbitmq:rabbitmq /etc/rabbitmq/rabbitmq.config /etc/rabbitmq/definitions.json
|
5
|
-
|
6
|
-
EXPOSE 5672 15672
|
8
|
+
RUN rabbitmq-plugins enable rabbitmq_web_stomp
|
data/docker/README.md
CHANGED
@@ -5,8 +5,8 @@ Please follow these steps to build and run a docker container with a predefined
|
|
5
5
|
|
6
6
|
* Have latest docker community edition installed (https://www.docker.com)
|
7
7
|
* cd into the docker folder
|
8
|
-
* docker
|
9
|
-
* docker
|
8
|
+
* docker-compose up --no-start
|
9
|
+
* docker-compose start
|
10
10
|
|
11
11
|
Is the docker container running fine?
|
12
12
|
Go to http://localhost:15672 and login to RabbitMQ Management Console with guest/guest
|
data/docker/definitions.json
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
{
|
2
|
-
"
|
2
|
+
"rabbitmq_version": "3.8.14",
|
3
|
+
"product_name": "RabbitMQ",
|
4
|
+
"product_version": "3.8.14",
|
3
5
|
"users": [
|
4
6
|
{
|
5
7
|
"name": "guest",
|
@@ -51,6 +53,13 @@
|
|
51
53
|
"durable": true,
|
52
54
|
"auto_delete": false,
|
53
55
|
"arguments": {}
|
56
|
+
},
|
57
|
+
{
|
58
|
+
"name": "processor2",
|
59
|
+
"vhost": "event_hub",
|
60
|
+
"durable": true,
|
61
|
+
"auto_delete": false,
|
62
|
+
"arguments": {}
|
54
63
|
}
|
55
64
|
],
|
56
65
|
"exchanges": [
|
@@ -80,6 +89,24 @@
|
|
80
89
|
"auto_delete": false,
|
81
90
|
"internal": false,
|
82
91
|
"arguments": {}
|
92
|
+
},
|
93
|
+
{
|
94
|
+
"name": "an_exchange",
|
95
|
+
"vhost": "event_hub",
|
96
|
+
"type": "direct",
|
97
|
+
"durable": true,
|
98
|
+
"auto_delete": false,
|
99
|
+
"internal": false,
|
100
|
+
"arguments": {}
|
101
|
+
},
|
102
|
+
{
|
103
|
+
"name": "processor2",
|
104
|
+
"vhost": "event_hub",
|
105
|
+
"type": "direct",
|
106
|
+
"durable": true,
|
107
|
+
"auto_delete": false,
|
108
|
+
"internal": false,
|
109
|
+
"arguments": {}
|
83
110
|
}
|
84
111
|
],
|
85
112
|
"bindings": [
|
@@ -106,6 +133,22 @@
|
|
106
133
|
"destination_type": "queue",
|
107
134
|
"routing_key": "",
|
108
135
|
"arguments": {}
|
136
|
+
},
|
137
|
+
{
|
138
|
+
"source": "an_exchange",
|
139
|
+
"vhost": "event_hub",
|
140
|
+
"destination": "example.outbound",
|
141
|
+
"destination_type": "queue",
|
142
|
+
"routing_key": "",
|
143
|
+
"arguments": {}
|
144
|
+
},
|
145
|
+
{
|
146
|
+
"source": "processor2",
|
147
|
+
"vhost": "event_hub",
|
148
|
+
"destination": "processor2",
|
149
|
+
"destination_type": "queue",
|
150
|
+
"routing_key": "",
|
151
|
+
"arguments": {}
|
109
152
|
}
|
110
153
|
]
|
111
154
|
}
|
data/docker/reset
ADDED
data/eventhub-processor2.gemspec
CHANGED
@@ -1,37 +1,38 @@
|
|
1
|
-
lib = File.expand_path(
|
1
|
+
lib = File.expand_path("../lib", __FILE__)
|
2
2
|
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
3
|
-
require
|
3
|
+
require "eventhub/version"
|
4
4
|
|
5
|
-
note =
|
5
|
+
note = "Next generation gem to build ruby based eventhub processor"
|
6
6
|
|
7
7
|
Gem::Specification.new do |spec|
|
8
|
-
spec.name
|
9
|
-
spec.version
|
10
|
-
spec.authors
|
11
|
-
spec.email
|
8
|
+
spec.name = "eventhub-processor2"
|
9
|
+
spec.version = EventHub::VERSION
|
10
|
+
spec.authors = ["Steiner, Thomas"]
|
11
|
+
spec.email = ["thomas.steiner@ikey.ch"]
|
12
12
|
|
13
|
-
spec.summary
|
14
|
-
spec.description
|
15
|
-
spec.homepage
|
16
|
-
spec.license
|
13
|
+
spec.summary = note
|
14
|
+
spec.description = note
|
15
|
+
spec.homepage = "https://github.com/thomis/eventhub-processor2"
|
16
|
+
spec.license = "MIT"
|
17
17
|
|
18
|
-
spec.files
|
18
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
19
19
|
f.match(%r{^(test|spec|features)/})
|
20
20
|
end
|
21
|
-
spec.bindir
|
22
|
-
spec.executables
|
23
|
-
spec.require_paths = [
|
21
|
+
spec.bindir = "exe"
|
22
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
23
|
+
spec.require_paths = ["lib"]
|
24
24
|
|
25
25
|
# required by celluloid and bunny (-> amq-protocol)
|
26
26
|
# spec.required_ruby_version = '~> 2.2.6'
|
27
27
|
|
28
|
-
spec.add_dependency
|
29
|
-
spec.add_dependency
|
30
|
-
spec.add_dependency
|
31
|
-
spec.add_dependency
|
28
|
+
spec.add_dependency "celluloid", "~> 0.18"
|
29
|
+
spec.add_dependency "bunny", "~> 2.15"
|
30
|
+
spec.add_dependency "eventhub-components", "~> 0.2"
|
31
|
+
spec.add_dependency "uuidtools", "~> 2.1"
|
32
32
|
|
33
|
-
spec.add_development_dependency
|
34
|
-
spec.add_development_dependency
|
35
|
-
spec.add_development_dependency
|
36
|
-
spec.add_development_dependency
|
33
|
+
spec.add_development_dependency "bundler", "~> 2.1"
|
34
|
+
spec.add_development_dependency "rake", "~> 13.0"
|
35
|
+
spec.add_development_dependency "rspec", "~> 3.9"
|
36
|
+
spec.add_development_dependency "simplecov", "~> 0.21"
|
37
|
+
spec.add_development_dependency "standardrb", "~> 1.0"
|
37
38
|
end
|