Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consume function fails #7

Open
the100rabh opened this issue Dec 12, 2014 · 2 comments
Open

Consume function fails #7

the100rabh opened this issue Dec 12, 2014 · 2 comments

Comments

@the100rabh
Copy link

I tried running consume function from php in interactive mode and it crashes php. produce function on the other hand works very well.

There are no logs that I can figure out. Any pointers to debug this will help.

@kcyeu
Copy link

kcyeu commented Mar 5, 2015

@the100rabh I have exactly the same issue, did you find the solution?

@EVODelavega
Copy link

Just a tip, I ran into the same issue, but if you look at the source code, you'll see that the kafka_consume function (in kafka.c) actually writes its error output to syslog (/var/log/syslog). just run a test-php script, check the exit code (echo $?), if the exit code is anything other than 0, tail the syslog and you'll probably see something like phpkafka - % Failed to start consuming: Local: Unknown partition show up.

There's also a slight issue with the format specifiers used in the extension, I've gotten output like this:

phpkafka - start_offset: -2 and offset passed: -618028960

which is down to the fact that start_offset is of the type int64_t, and the format specifier is %d (whereas it should be "%" PRId64 "...").

Anyway, call the set_partition method before consuming should fix the problem, it did for me anyway. Meanwhile, I've set about putting together a quick-fix PR here, you can check to see if this fixes the issue by using my fork (branch consume-fix). Just compile and install as normal. It should work just fine

EVODelavega pushed a commit to EVODelavega/phpkafka that referenced this issue Jun 24, 2015
* commit 'e52e0c8cadd1766404e2d834681863c4043db7ab':
  Do not pass timeout of 0 ms (== NOWAIT kafka)
  Test new methods
  Add method en enable/disable logging
  Add getTopics method -> use meta-api
  Add setBrokers method -> switch connection on instance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants