Azure Service Bus Emulator helping with local development experience and integration testing
10K+
Emulator is really an AMQP 1.0 proxy that translates Azure Service Bus specifics into backend implementation specifics. Backend is an actual queue implementation that runs locally, not in cloud, and handles the messages. The main use case is to help with local development experience and with integration testing where application code cannot change driver easily.
See https://devopsifyme.com and https://github.com/piotr-rojek/devopsifyme-sbemulator for more information.
Your Azure Service Bus Connection String
"Endpoint=sb://localhost/;SharedAccessKeyName=all;SharedAccessKey=CLwo3FQ3S39Z4pFOQDefaiUd1dSsli4XOAj3Y9Uh1E=;EnableAmqpLinkRedirect=false"
# Bring containers up
curl https://raw.githubusercontent.com/piotr-rojek/devopsifyme-sbemulator/main/docker-compose.yml --output docker-compose.yml
docker compose up --detach --no-build
# Trust our test certificate
$containerPrefix = Split-Path (Get-Location) -Leaf
docker cp $containerPrefix-emulator-1:/app/cacert.cer cacert.cer
Import-Certificate -FilePath cacert.cer -CertStoreLocation cert:\CurrentUser\Root
| Environmental Variable | Docker Default | Description |
|---|---|---|
| Emulator__QueuesAndTopics | Coma-separated list of queues and topics to be created on startup. See below | |
| Emulator__Port | 5671 | Port on which service is listening |
| Emulator__ServerCertificatePath | /app/cert.pfx | Path to a PFX file containing emulator's TLS certificate |
| Emulator__ServerCertificatePassword | password | Password for the PFX file |
| Emulator__ServerCertificateThumbprint | Server certificate in current user's certificate store | |
| Emulator__RabbitMq__Username | guest | RabbitMQ backend - username |
| Emulator__RabbitMq__Password | guest | RabbitMQ backend - password |
| Emulator__RabbitMq__Host | localhost | RabbitMQ backend - hostname |
| Emulator__RabbitMq__Port | 5672 | RabbitMQ backend - port |
You can use this to preinitialize queues and topics, if your tests require this. Otherwise some messages sent might be lost, if the receiver connects after they are sent. For example, integration tests in this repo rely on this setting (see docker-compose.integration.yml).
Sample value
queue-name;topic-name/Subscriptions/sub1;topic-name/Subscriptions/sub2
If you don't want to trust provided test CA, you can provide your own server certificate. Mount your PFX file in any directory, and update environmental variables Emulator__ServerCertificatePath and Emulator__ServerCertificatePassword.
Note that the provided server certificate is regenerated each release, so it is not convenient to trust it. Therefore by default it is required to trust the Test CA from this repository. Since this certificate is publicly available here, it could potentially allow attacker to generate any certificate that you would trust.
Content type
Image
Digest
sha256:4d31ba0bf…
Size
96.8 MB
Last updated
over 3 years ago
docker pull devopsifyme/sbemu