Skip to content

Conversation

@johanandren
Copy link
Contributor

Couldn't decide if it should be shown in reference docs or not.

if (method.getParameterTypes.last.isSealed) {
method.getParameterTypes.last.getPermittedSubclasses.toList
if (inputType.isSealed) {
inputType.getPermittedSubclasses.toList
Copy link
Contributor Author

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"
}
Copy link
Contributor Author

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) {
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@johanandren johanandren marked this pull request as ready for review November 3, 2025 13:54
@johanandren johanandren force-pushed the wip-arbitrary-raw-payload-to-consumer branch from 62cfc35 to b641753 Compare November 3, 2025 15:40
@johanandren johanandren merged commit e0b1018 into main Nov 4, 2025
59 of 60 checks passed
@johanandren johanandren deleted the wip-arbitrary-raw-payload-to-consumer branch November 4, 2025 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants