anschel 0.6.4 → 0.6.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/anschel/input/kafka.rb +2 -2
- data/lib/anschel/input/rabbitmq.rb +23 -11
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bbe6eb2c7595931308ffa51a7c5c246d70bc0bd2
|
4
|
+
data.tar.gz: c982d14ef5c18395f19dea1803875ee81dce3377
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a7664952bdf55874f8f883dead99b346034d565462d11e37246ce9437f0d730721eb1726333e492731f159bae02779c5cdbbeaeea80655135fe51ef7a49b6841
|
7
|
+
data.tar.gz: 9dccba8d5cd9cef7ce7e841c95a224807a297091503a9eef98787e75f9d22fbd751149638bca0e0af93ac6d4b4d2f77bb23ec37a0186bfc389e10e9f5bd2f083
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.6.
|
1
|
+
0.6.5
|
data/lib/anschel/input/kafka.rb
CHANGED
@@ -6,9 +6,9 @@ require_relative 'base'
|
|
6
6
|
module Anschel
|
7
7
|
class Input
|
8
8
|
class Kafka < Base
|
9
|
-
def initialize
|
9
|
+
def initialize output, config, stats, log
|
10
10
|
@consumer_group = ::Kafka::Group.new config
|
11
|
-
@consumer_group.run num_cpus,
|
11
|
+
@consumer_group.run num_cpus, output
|
12
12
|
end
|
13
13
|
|
14
14
|
def stop
|
@@ -6,31 +6,43 @@ require_relative 'base'
|
|
6
6
|
module Anschel
|
7
7
|
class Input
|
8
8
|
class RabbitMQ < Base
|
9
|
-
def initialize
|
10
|
-
|
9
|
+
def initialize output, config, stats, log
|
10
|
+
exchange_defaults = {
|
11
11
|
type: 'x-consistent-hash',
|
12
12
|
durable: true
|
13
13
|
}
|
14
14
|
|
15
|
-
|
15
|
+
queue_defaults = {
|
16
16
|
exclusive: false,
|
17
17
|
auto_delete: false,
|
18
18
|
durable: true
|
19
19
|
}
|
20
20
|
|
21
|
+
subscription_defaults = {
|
22
|
+
block: true,
|
23
|
+
ack: true
|
24
|
+
}
|
25
|
+
|
21
26
|
exchange_name = config[:exchange].delete(:name)
|
22
27
|
|
23
|
-
@threads = config[:queues].map do |
|
28
|
+
@threads = config[:queues].map do |queue_name, queue_config|
|
24
29
|
Thread.new do
|
25
|
-
|
26
|
-
|
30
|
+
connection = ::MarchHare.connect config[:connection]
|
31
|
+
|
32
|
+
channel = connection.create_channel
|
33
|
+
|
34
|
+
exchange = channel.exchange exchange_name, \
|
35
|
+
exchange_defaults.merge(config[:exchange])
|
36
|
+
|
37
|
+
queue = channel.queue queue_name.to_s, \
|
38
|
+
queue_defaults.merge(queue_config)
|
27
39
|
|
28
|
-
|
29
|
-
|
40
|
+
subscription = subscription_defaults.merge \
|
41
|
+
(config[:subscription] || {})
|
30
42
|
|
31
|
-
|
32
|
-
|
33
|
-
|
43
|
+
queue.subscribe(subscription) do |meta, message|
|
44
|
+
output << message
|
45
|
+
channel.ack meta.delivery_tag, false if subscription[:ack]
|
34
46
|
end
|
35
47
|
end
|
36
48
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: anschel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Clemmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|
@@ -165,3 +165,4 @@ signing_key:
|
|
165
165
|
specification_version: 4
|
166
166
|
summary: Logstash-like for moving events from Kafka into Elasticsearch
|
167
167
|
test_files: []
|
168
|
+
has_rdoc:
|