-
Notifications
You must be signed in to change notification settings - Fork 9
feat: Consumer passthrough of raw payloads as byte arrays #1073
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
Conversation
| if (method.getParameterTypes.last.isSealed) { | ||
| method.getParameterTypes.last.getPermittedSubclasses.toList | ||
| if (inputType.isSealed) { | ||
| inputType.getPermittedSubclasses.toList |
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.
Unrelated boyscouting
| AnySupport.typeUrlToContentType( | ||
| "type.googleapis.com/google.protobuf.BytesValue") shouldEqual "application/grpc+proto; message=google.protobuf.BytesValue" | ||
| AnySupport.typeUrlToContentType("json.akka.io/multiplied") shouldEqual "application/json; type=multiplied" | ||
| } |
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.
We should probably move this into runtime consumer logic, the application/vnd.kalix.protobuf.any datacontenttype is a runtime implementation detail.
| // Note: this doesn't really make sense for an event sourced entity, but is easier to test than | ||
| // for a service to service | ||
| // or topic which are sensible use cases for raw payloads | ||
| public Effect raw(byte[] bytes) { |
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.
Is that correct to allow for a raw bytes handler mixed with a specific event type handler?
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.
It's a bit weird, but would allow something like a topic where some messages are json and some are some byte payload. I don't think it hurts or complicates anything allowing it.
62cfc35 to
b641753
Compare
Couldn't decide if it should be shown in reference docs or not.