Each invocation has its own unique ID and lifecycle.
Have a look at managing invocations to learn how to manage the lifecycle of an invocation.
Always invoke handlers via the context, if you have access to it.
Restate then attaches information about the invocation to the parent invocation.
Invoking handlers with the SDK clients
First, add the dependency to your project- For Java:
- For Kotlin:
- Request-response invocations allow you to wait on a response from the handler.
- One-way invocations allow you to send a message without waiting for a response.
- Delayed invocations allow you to schedule an invocation for a later point in time.
Invoke a handler idempotently
By using Restate and an idempotency key, you can make any service call idempotent, without any extra code or setup. This is a very powerful feature to ensure that your system stays consistent and doesn’t perform the same operation multiple times. To make a service call idempotent, you can use the idempotency key feature. Add the idempotency key to the header via:Check out the service configuration docs to tune the retention time.