-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Description
Describe the bug
Spring boot cannot connect to service bus emulator running on docker in a linux machine.
Exception or Stack Trace
Connection attempt:[200] to: amqps://192.168.15.18:-1 failed
To Reproduce
Run the service bus in the emulator on docker in linux
Try to configure the spring boot application connection to the service bus using the application.yml file
The version of the dependency is <spring-cloud-azure.version>5.23.0</spring-cloud-azure.version>
Code Snippet
spring:
jms:
servicebus:
connection-string: "Endpoint=sb://192.168.15.18;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=SAS_KEY_VALUE;UseDevelopmentEmulator=true"
pricing-tier: standard
namespace: sbemulatorns
enabled: true
services:
emulator:
container_name: "servicebus-emulator"
image: mcr.microsoft.com/azure-messaging/servicebus-emulator:latest
pull_policy: always
volumes:
- "${CONFIG_PATH}:/ServiceBus_Emulator/ConfigFiles/Config.json"
ports:
- "5672:5672"
- "5671:5671"
- "5300:5300"
environment:
SQL_SERVER: mssql
MSSQL_SA_PASSWORD: "${MSSQL_SA_PASSWORD}" # Password should be same as what is set for SQL Server Linux
ACCEPT_EULA: ${ACCEPT_EULA}
SQL_WAIT_INTERVAL: ${SQL_WAIT_INTERVAL} # Optional: Time in seconds to wait for SQL to be ready (default is 15 seconds)
AZURE_CLOUD_TYPE: LOCAL
AZURE_CLIENT_TELEMETRY_DISABLED: "true"
Expected behavior
On startup the application should be able to connect to the service bus
Setup (please complete the following information):
- OS: Linux
- Library/Libraries: <spring-cloud-azure.version>5.23.0</spring-cloud-azure.version>
- Java version: 21
- Frameworks: spring boot
Additional Information:
I tried adding the port number 5672 to my connection-string but it did not work. I also create a simple python code to send and receive messages to the same container and it was successful.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status