Skip to content

Upcaster#594

Open
m1l4n54v1c wants to merge 3 commits intorestatedev:mainfrom
m1l4n54v1c:upcaster
Open

Upcaster#594
m1l4n54v1c wants to merge 3 commits intorestatedev:mainfrom
m1l4n54v1c:upcaster

Conversation

@m1l4n54v1c
Copy link

  • Enable schema evolution and backward compatibility by allowing payload upcasting at the state machine boundary.
  • Provide Upcasters with enough context (such as the core message type and selected header keys) to make informed transformation decisions.
  • Ensure system robustness: failures during upcasting must not break invocation processing.

Upcaster:

public interface Upcaster {
  boolean canUpcast(Slice body, Map<String, String> headers);

  Slice upcast(Slice body, Map<String, String> headers);
}

The upcaster is invoked for relevant protocol messages before handed over to the current state of the StateMachine. Messages carrying any form of payload. It could be that certain messages could be left out.

To help Upcaster implementations, metadata is constructed that includes the name of the core message and, where applicable, relevant information.

Since there is no hierarchy/generalization in messages, DefaultInvocationInputUpcaster is a bit verbose. I'm open to suggestions on how to improve it.

I see this as a conversation starter rather than a final solution. Looking forward to the feedback.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 25, 2026

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@m1l4n54v1c
Copy link
Author

I have read the CLA Document and I hereby sign the CLA

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

Successfully merging this pull request may close these issues.

1 participant