codeclimate-kafka 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cc/kafka/producer.rb +7 -11
- data/lib/cc/kafka/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c879ad2675e462df020c9ea423891e439c9a180c
|
4
|
+
data.tar.gz: 17736d6479420bcf9621f328fc8d841386a76074
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9780a0c3cc0dd70d150fc75b2c9929fad4ff2ad0d9055c9dce5dc38bad6bd2c36083b12253b8019b924ec6374aafa0d7d59c450d0a4fceed36713909259f49d4
|
7
|
+
data.tar.gz: 6ef034f1724bbe081dbcb5cb512d103f550136a7d93b8f84ccaffd436e7940e327d8ce1a5de41ec99d4213f755246acbd6f2ea56d99a206d1ec6665bad6a70ae
|
data/lib/cc/kafka/producer.rb
CHANGED
@@ -46,24 +46,20 @@ module CC
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def send_http(serialized, key)
|
49
|
-
data = {
|
50
|
-
"topic" => topic,
|
51
|
-
"message" => serialized,
|
52
|
-
}
|
53
|
-
data["key"] = key if key
|
54
|
-
|
55
49
|
http = Net::HTTP.new(uri.host, uri.port)
|
56
50
|
http.open_timeout = HTTP_TIMEOUT
|
57
51
|
http.read_timeout = HTTP_TIMEOUT
|
58
|
-
request = Net::HTTP::Post.new("/
|
59
|
-
request
|
52
|
+
request = Net::HTTP::Post.new("/")
|
53
|
+
request["Topic"] = topic
|
54
|
+
request["Key"] = key if key
|
55
|
+
request.body = serialized
|
60
56
|
|
61
|
-
Kafka.logger.debug("POST #{uri.host}:#{uri.port}/
|
62
|
-
Kafka.logger.debug("
|
57
|
+
Kafka.logger.debug("POST #{uri.host}:#{uri.port}/")
|
58
|
+
Kafka.logger.debug("data: #{serialized.inspect}")
|
63
59
|
response = http.request(request)
|
64
60
|
|
65
61
|
unless response.is_a?(Net::HTTPSuccess)
|
66
|
-
raise HTTPError, "request not successful: #{response.
|
62
|
+
raise HTTPError, "request not successful: (#{response.code}) #{response.body}"
|
67
63
|
end
|
68
64
|
end
|
69
65
|
|
data/lib/cc/kafka/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: codeclimate-kafka
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Code Climate
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-07-
|
11
|
+
date: 2015-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bson
|