-
Notifications
You must be signed in to change notification settings - Fork 215
Creating Message from ConcreteMessageBuilder #137
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
Comments
Regarding the |
Thanks for getting back to me! I don't need a message handle when producing, that's just the only way I saw in the api to construct a message, but using anything from rd_kafka seemed like improper use of the cppkafka api. For ConcreteMessageBuilder, I don't see how it can be implicitly converted to a MessageBuilder when T != string. ConcreteMessageBuilder and MessageBuilder inherit from BasicMessageBuilder, but Concrete doesn't inherit from MessageBuilder. The example you gave works fine since Concrete is the same type as MessageBuilder, but again, I don't see how to use produce() when T != string |
From what little experience I have with templates it seems like you would need a templated overload of produce(): template |
This should work as it is. It works because of this constructor. Did you actually try doing this? |
My relevant changes to producer_example.cpp
In file included from ../include/cppkafka/producer.h:39:0, |
You can't really use doubles. How do you encode doubles on the wire? The idea (and this should probably be stated in the API) is that you provide some type of buffer that holds the data (e.g. |
Ah gotcha! Thank you for the clarification of sending over the wire- now I understand why there's the limitation. I got it to work with vector |
Does your api support using non stl containers like char[]/void* and a size to construct payloads? |
I don't think that will work. There should be another overload like this one for |
What's your protocol for testing on pull requests? |
Is there a way to use the concrete message builder class to build messages for the Producer to use? The only produce() arguments in producer.h that I see are r/l references to either Messages, or MessageBuilders. I also don't see any functions that return an instance of Message except the one that uses an rd_kafka_message_t* (in message.h:85) as an argument, but if I need to create that myself it seems to make the concrete message builder obsolete, so I know that I'm missing something. An help is much appreciated!
The text was updated successfully, but these errors were encountered: