-
Notifications
You must be signed in to change notification settings - Fork 61
feat(v2): full implementation for kafka bindings #253
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
base: v2
Are you sure you want to change the base?
feat(v2): full implementation for kafka bindings #253
Conversation
Signed-off-by: Tudor Plugaru <[email protected]>
…licitly import Signed-off-by: Tudor Plugaru <[email protected]>
|
@xSAVIKx here's another one. Another topic that I'd like to discuss is what would be the approach next? I'd like to remove entirely Also, what's your take on the protocol implementation? I took a look at |
|
@xSAVIKx ping, in case you somehow missed the notification. thanks |
|
Hey @PlugaruT , thx for the ping. I did miss it. I will try to get back with an answer and a review later today. Thank you 🙏 |
xSAVIKx
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@PlugaruT LGTM 👍
Let me know if you want to handle those suggestions. But it can be done separately as well.
| def from_binary( | ||
| message: KafkaMessage, | ||
| event_format: Format, | ||
| event_factory: Callable[ | ||
| [dict[str, Any], dict[str, Any] | str | bytes | None], BaseCloudEvent | ||
| ], | ||
| ) -> BaseCloudEvent: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is a perfectly correct implementation, I was just thinking that 99% of users will do what you added in the example:
from_binary(message, JSONFormat(), CloudEvent)
It probably is a good idea to have this shortcut for them as well. Maybe with smth like:
cloud_event_binary_from(message)
WDYT?
| def from_structured( | ||
| message: KafkaMessage, | ||
| event_format: Format, | ||
| event_factory: Callable[ | ||
| [dict[str, Any], dict[str, Any] | str | bytes | None], BaseCloudEvent | ||
| ], | ||
| ) -> BaseCloudEvent: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
and similarly here we can provide a shortcut like:
cloud_event_structured_from(message)
IMO it is a good idea to release a first v2 version with v1 compatibility package. And then remove the compatibility package in a follow-up release.
the main package should be kept lightweight - that's for sure. we can implement the full support for a desired library/libraries as optional deps or separate packages IMO. |
Changes
One line description for the changelog