Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Support binary message #179

Closed
amiorin opened this issue Jun 11, 2015 · 5 comments
Closed

Support binary message #179

amiorin opened this issue Jun 11, 2015 · 5 comments

Comments

@amiorin
Copy link

amiorin commented Jun 11, 2015

Reading the source code and the manual (http://pykafka.readthedocs.org/en/latest/api/producer.html#pykafka.producer.Producer.produce), it looks there is no support for binary messages.
Only string messages are supported.
Why is that?

@kbourgoin
Copy link
Contributor

Huh, that's actually a holdover from samsa which I never questioned. We only use Kafka for string data, so it never even occurred to me. We'll add that into the next release, to accept any byte data instead of just strings.

@kbourgoin kbourgoin added this to the 1.0.3 milestone Jun 11, 2015
@yungchin
Copy link
Contributor

yungchin commented Jun 11, 2015 via email

@amiorin
Copy link
Author

amiorin commented Jun 11, 2015

thx. I'll try with thrift.

yungchin added a commit that referenced this issue Jun 27, 2015
As discussed in #189 this test would previously stall randomly, waiting
forever until you'd hit ctrl-c.  The change demonstrates that the
problem is test-suite related: we put a timeout on the consumer, and as
a result we get a test error whenever None (== timed out) is returned
from consume(), instead of the stalling.

In log output, we see one of two things whenever the test errors out.
Either we get the wrong consumer offset straight away:

    DEBUG - pykafka.simpleconsumer - Set offset for partition 2 to 0

(where offset -1 is expected, on a fresh topic), or

    INFO - pykafka.simpleconsumer - Resetting offsets for 1 partitions

(which, by default settings, will jump to OffsetType.LATEST, ie past the
 freshly produced message we want to get).  Neither of these should
occur if the test harness hands us a newly created topic, as we expect.

On a side note, this resolves #179 because we now test with a binary
string, and that works (when it doesn't stall).

Signed-off-by: Yung-Chin Oei <yungchin@yungchin.nl>
@yungchin
Copy link
Contributor

I've just pushed a test that produces and consumes a binary string, so this should hopefully work for you as is.

@amiorin
Copy link
Author

amiorin commented Jun 27, 2015

thx, I'll check it out

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants