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

handle_messages sometimes receives nil as argument #47

Open
crmdias opened this issue Nov 22, 2017 · 1 comment
Open

handle_messages sometimes receives nil as argument #47

crmdias opened this issue Nov 22, 2017 · 1 comment

Comments

@crmdias
Copy link

crmdias commented Nov 22, 2017

Hello there! First of all, congratulations on your work with this library and thanks a lot for it. We have been using it at DeepX with quite a degree of success this far, and it has been really helpful.

This issue started happening after 1.4.0, and we believe it to be related to the upgrade to brod 3.0.

Sometimes when Kaffe calls our implementation of handle_messages for batch message processing, it gives nil as argument, which gives us a crash when we try to use the given argument as an enumerator, such as below:

  def handle_messages(messages) do
    for message <- messages do
      message.value
      |> Poison.decode()
      |> process_message(message.topic)
    end
    :ok
  end

Could you clarify whether this is a bug or an intended case of this function?
Thank you very much!

@objectuser
Copy link
Contributor

@cristianormd Hello! Glad you're having success with Kaffe!

That's an interesting issue. Are you receiving nil for messages or are you receiving [nil]? Looking at this code, I'm guessing the latter.

That's definitely not the intent. 😉 So I think this would be a defect in either Kaffe or Brod. Which version of Brod are you using?

I wonder if we're handing the message incorrectly in the subscriber for Brod 3. This might require some digging in Brod.

I don't think we've seen this issue yet. @cristianormd Would you like to try to isolate the issue, either in Kaffe or Brod?

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

2 participants