Skip to main content

Registration

After deploying an endpoint, you need to register it with Restate. That way Restate knows where it runs and can invoke it.

Registering deployments

Register a service endpoint URI as follows:


restate deployments register localhost:9080

Output

❯ SERVICES THAT WILL BE ADDED:
- CheckoutService
Type: Service
HANDLER INPUT TYPE OUTPUT TYPE
handle one of "empty or value of content-type */*" value with content-type "application/json"
- CartObject
Type: VirtualObject ⬅️ 🚶🚶🚶
HANDLER INPUT TYPE OUTPUT TYPE
addTicket one of "empty or value of content-type */*" value with content-type "application/json"
expireTicket one of "empty or value of content-type */*" value with content-type "application/json"
checkout one of "empty or value of content-type */*" value with content-type "application/json"
- TicketObject
Type: VirtualObject ⬅️ 🚶🚶🚶
HANDLER INPUT TYPE OUTPUT TYPE
reserve one of "empty or value of content-type */*" value with content-type "application/json"
markAsSold one of "empty or value of content-type */*" value with content-type "application/json"
unreserve one of "empty or value of content-type */*" value with content-type "application/json"
✔ Are you sure you want to apply those changes? · yes
✅ DEPLOYMENT:
SERVICE REV
TicketObject 1
CheckoutService 1
CartObject 1

Or you can use the shorthand restate dp add.

To register a Lambda handler, replace http://localhost:9080 by the ARN of the Lambda function, for example arn:aws:lambda:my-region:123456789101:function:my-function:my-version.

Running locally Restate with Docker

When running Restate in a Docker, replace localhost with host.docker.internal.

Updating services

A service can be registered only once. Subsequent registration requests to the same deployment will fail. For more details on how to update services, check the versioning docs.

When developing locally, you can forcefully overwrite an existing deployment:


restate deployments register --force localhost:9080

This will forcefully overwrite the existing service deployment with the same URI, forcing the discovery process again. It will also remove services that were served by that deployment and are not available anymore.

warning

Forcing a deployment registration is a feature designed to simplify local Restate service development, and should never be used in a production Restate deployment, as it potentially breaks all the in-flight invocations to that deployment.

info

After registration, services can also be marked as 'private' to prevent them from being invoked through the ingress. See the Security docs for more information.