efgpinto / kalix-java-protobuf-startup-trigger

Tiny sample showing how to configure a trigger on startup.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

java-protobuf-startup-trigger

Designing

While designing your service it is useful to read designing services

Developing

This project has a bare-bones skeleton service ready to go, but in order to adapt and extend it, it may be useful to read up on developing services and in particular the Java section

Building

You can use Maven to build your project, which will also take care of generating code based on the .proto definitions:

mvn compile

Running Locally

When running a Kalix service locally, we need to have its companion Kalix Runtime running alongside it.

To start your service locally, run:

mvn kalix:runAll

You will see a log like this:

09:49:46.484 INFO  com.example.ExampleActionImpl - Example action initializing...

This means the init method on the Action was actually run.

Deploying

To deploy your service, install the kalix CLI as documented in Setting up a local development environment and configure a Docker Registry to upload your docker image to.

You will need to update the dockerImage property in the pom.xml and refer to Configuring registries for more information on how to make your docker image available to Kalix.

Finally, you use the kalix CLI to create a project as described in Create a new Project. Once you have a project you can deploy your service into the project either by using mvn deploy kalix:deploy which will package, publish your docker image, and deploy your service to Kalix, or by first packaging and publishing the docker image through mvn deploy and then deploying the image through the kalix CLI.

About

Tiny sample showing how to configure a trigger on startup.


Languages

Language:Java 100.0%