I am trying to submit Temporal workflow using a springboot application, and i am using docker compose.
Creating the stub using below code
WorkflowServiceStubsOptions workflowServiceStubsOptions = WorkflowServiceStubsOptions.newBuilder()
.setTarget(temporalServerUrl).build();
WorkflowServiceStubs.newServiceStubs(workflowServiceStubsOptions);
‘temporalServerUrl’ is the property passing to the docker file as property name as ‘temporal.server.url’
Below is the snippet of compose file
version: "3.5"
services:
temporal:
container_name: temporal
depends_on:
- postgresql
environment:
- DB=postgresql
- DB_PORT=5432
- POSTGRES_USER=temporal
- POSTGRES_PWD=temporal
- POSTGRES_SEEDS=postgresql
- DYNAMIC_CONFIG_FILE_PATH=config/dynamicconfig/development-sql.yaml
image: temporalio/auto-setup:${TEMPORAL_VERSION}
networks:
- temporal-network
ports:
- 7233:7233
volumes:
- ./dynamicconfig:/etc/temporal/config/dynamicconfig
labels:
kompose.volume.type: configMap
temporal-ps-wf-submit:
container_name: temporal-ps-wf-submit
depends_on:
- temporal
environment:
- TEMPORAL_ADDRESS=temporal:7233
- TEMPORAL_CORS_ORIGINS=http://localhost:3000
- temporal.server.url=temporal:7233
image: postgres-workflow-client:1.0.0
networks:
- temporal-network
ports:
- 8181:8181
stdin_open: true
tty: true
When run the compose file, it is showing below error.
2024-04-28T07:06:15.338Z WARN 1 --- [ault-executor-0] io.grpc.internal.ManagedChannelImpl : [Channel<1>: (temporal:7233)] Failed to resolve name. status=Status{code=UNAVAILABLE, description=Unable to resolve host temporal, cause=java.lang.RuntimeException: java.net.UnknownHostException: temporal: Name or service not known
at io.grpc.internal.DnsNameResolver.resolveAddresses(DnsNameResolver.java:223)
at io.grpc.internal.DnsNameResolver.doResolve(DnsNameResolver.java:282)
at io.grpc.internal.DnsNameResolver$Resolve.run(DnsNameResolver.java:318)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.base/java.lang.Thread.run(Unknown Source)
Caused by: java.net.UnknownHostException: temporal: Name or service not known
at java.base/java.net.Inet4AddressImpl.lookupAllHostAddr(Native Method)
at java.base/java.net.InetAddress$PlatformNameService.lookupAllHostAddr(Unknown Source)
at java.base/java.net.InetAddress.getAddressesFromNameService(Unknown Source)
at java.base/java.net.InetAddress$NameServiceAddresses.get(Unknown Source)
Any clue?
Thanks in Adv