kafka_rest 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/lib/kafka_rest/topic.rb +6 -4
- data/lib/kafka_rest/version.rb +1 -1
- 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: 5838cebb0452e8d735cd3909d0b4ff0369267650
|
4
|
+
data.tar.gz: 1cbb28c110e2740222a16b43a35661984408856c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d4570abfdbd64e881705bf7adf5a639bc4bbd9463499b7cd54adf5856eabab4a7796f9236220809ad9ce637c2cf6db6ccd02de9c1135c9e8fb9fe89696fae3
|
7
|
+
data.tar.gz: 925c464004a994b21ca22752e7b519dadd3728a0cb579637f2f7438d9a1e3c9c6f85146cd156da0683f5cca4904869a1bf1e0e657fe1942942aafd0c22ca4396
|
data/README.md
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
[![Build Status](https://travis-ci.org/jjlangholtz/kafka_rest.svg?branch=master)](https://travis-ci.org/jjlangholtz/kafka_rest)
|
2
|
+
|
1
3
|
# KafkaRest
|
2
4
|
|
3
5
|
A ruby wrapper for Kakfa Rest Proxy.
|
@@ -65,6 +67,12 @@ partition.produce(message)
|
|
65
67
|
|
66
68
|
# You can even produce messages asynchronously
|
67
69
|
partition.produce_async(message)
|
70
|
+
|
71
|
+
# To produce Avro encoded messages, parse a schema definition and pass to topic
|
72
|
+
schema = KafkaRest::Schema.parse('Foo.avsc')
|
73
|
+
topic = KafkaRest.topic('Foo', schema)
|
74
|
+
|
75
|
+
topic.produce(value: message)
|
68
76
|
```
|
69
77
|
|
70
78
|
#### Consuming
|
data/lib/kafka_rest/topic.rb
CHANGED
@@ -38,10 +38,12 @@ module KafkaRest
|
|
38
38
|
def produce(*messages)
|
39
39
|
payload = { records: format(messages) }
|
40
40
|
|
41
|
-
if schema
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
if schema
|
42
|
+
if schema.id
|
43
|
+
payload[:value_schema_id] = schema.id
|
44
|
+
else
|
45
|
+
payload[:value_schema] = schema.serialized
|
46
|
+
end
|
45
47
|
end
|
46
48
|
|
47
49
|
res = client.post(topic_path, payload, schema, true)
|
data/lib/kafka_rest/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kafka_rest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josh Langholtz
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -152,3 +152,4 @@ signing_key:
|
|
152
152
|
specification_version: 4
|
153
153
|
summary: Ruby wrapper for the Kafka REST Proxy
|
154
154
|
test_files: []
|
155
|
+
has_rdoc:
|