Skip to main content

Connect MicroExecutor to Data

To connect the MicroExecutor to Data container, follow this steps:

1. Create a new file compose.override.yaml in the root of your local data-docker-compose repository, with the following contents:

services:
dispatcher:
environment:
- <ME_ID_CW>_URL>=http://host.docker.internal:<ME_PORT>
  • <ME_ID_CW> is MicroExecutor ID in capital words separeted by underscores
  • <ME_PORT> is the port your MicroExecutor is listening on
Example
  • MicroExecutor ID: me-java-test
  • MicroExecutor port: 8181
services:
dispatcher:
environment:
- ME_JAVA_TEST_URL=http://host.docker.internal:8181

2. Inside your Kokos DSLs, register your MicroExecutor and related services in register.yaml

handlers:
<ME_ID>:
url: ${<ME_ID_CW>_URL:=http://host.docker.internal:<ME_PORT>}

services:
names:
<ME_SERVICE_NAME>:
handler: <ME_ID>
  • <ME_ID> is your MicroExecutor ID
  • url must be the same declared in the compose.override.yaml
  • <ME_SERVICE_NAME> is the service of your MicroExecutor that you want to expose
Example
  • MicroExecutor ID: me-java-test
  • MicroExecutor port: 8181
  • MicroExecutor service name: EXM_TEST_00
handlers:
me-java-test:
url: ${ME_JAVA_TEST_URL=http://host.docker.internal:8181}

services:
names:
EXM_TEST_00:
handler: me-java-test

See more details about service routing

3. Run Data with Docker Compose

docker compose --profile default up

4. Run the MicroExecutor in your local IDE

5. Let's FUN!
From webup.js or the kokos-dispatcher Swagger UI, try calling a FUN containing a service that's implemented in your MicroExecutor!