Azure Service Bus
Parity grade: B · SDK azure-sdk-for-go/sdk/messaging/azservicebus@v1.11.0 · last audited 2026-10-20 (a5f048bc5)
Category: Azure · View PARITY.md on GitHub · All Services
In-memory Azure Service Bus with two front ends over one backend: the Brokered Messaging REST API and an AMQP 1.0 listener. Queues, topics, subscriptions, peek-lock, dead-letter queues and sessions.
Quick start
Official SDKs (azservicebus) speak AMQP 1.0 only. Connect to the AMQP listener with the development emulator connection string:
Endpoint=sb://localhost;SharedAccessKeyName=RootManageSharedAccessKey;SharedAccessKey=2R1W2VORtFi9HrmRQ1Gxp7xbySq7W0FAs2BvTZDdXeo=;UseDevelopmentEmulator=true;For TLS on port 5671 the certificate is self-signed. Supply ClientOptions.TLSConfig and set ServerName, because the SDK uses host:port as the TLS server name.
REST with curl:
curl -X PUT "http://localhost:10003/my-queue"
curl -X POST "http://localhost:10003/my-queue/messages" --data "hello world"
# Peek-lock: BrokerProperties carries MessageId/LockToken; Location gives the complete/abandon URL
curl -i -X POST "http://localhost:10003/my-queue/messages/head"
curl -X DELETE "http://localhost:10003/my-queue/messages/<id>/<locktoken>" # complete
curl -X PUT "http://localhost:10003/my-queue/messages/<id>/<locktoken>" # abandon
# Topic and subscription
curl -X PUT "http://localhost:10003/my-topic?type=topic"
curl -X PUT "http://localhost:10003/my-topic/subscriptions/my-sub"
curl -X POST "http://localhost:10003/my-topic/messages" --data "fan-out"
curl -X POST "http://localhost:10003/my-topic/subscriptions/my-sub/messages/head"
# Dead-letter sub-queue
curl -X POST "http://localhost:10003/my-queue/\$DeadLetterQueue/messages/head"Supported operations (REST)
| Area | Operations |
|---|---|
| Queues | CreateQueue, DeleteQueue, GetQueue, ListQueues |
| Topics | CreateTopic, DeleteTopic, GetTopic, ListTopics |
| Subscriptions | CreateSubscription, DeleteSubscription, GetSubscription, ListSubscriptions |
| Messages | SendMessage (metadata in the BrokerProperties header), PeekLockMessage, ReceiveAndDeleteMessage, PeekMessages, CompleteMessage, AbandonMessage, DeadLetterMessage |
- Queue vs topic is detected from the Atom+XML body root (
QueueDescriptionorTopicDescription), or from?type=topic. LockDuration,MaxDeliveryCountandDefaultMessageTimeToLiveare per entity.PeekLockhonours a long-polltimeout, capped at 30 s.- A janitor (10 s) releases expired locks, dead-letters on
MaxDeliveryCountexhaustion and dead-letters TTL-expired messages. - Sessions work on the AMQP plane. Over REST a session entity rejects a send without
SessionId, and peek-lock or destructive reads return 400.
Configuration
Each listener runs on its own port. Startup fails if a port is taken.
| Flag | Env | Default | Purpose |
|---|---|---|---|
--azure-servicebus-port | AZURE_SERVICEBUS_PORT | 10003 | REST port |
--azure-servicebus-amqp-port | AZURE_SERVICEBUS_AMQP_PORT | 5672 | Plain AMQP 1.0. 0 disables |
--azure-servicebus-amqp-tls-port | AZURE_SERVICEBUS_AMQP_TLS_PORT | 5671 | AMQP 1.0 over TLS, self-signed certificate. 0 disables |
--azure-servicebus-validate-sas | AZURE_SERVICEBUS_VALIDATE_SAS | false | Verify SAS token HMAC-SHA256 signatures |
Default namespace sbemulatorns, key name RootManageSharedAccessKey, key 2R1W2VORtFi9HrmRQ1Gxp7xbySq7W0FAs2BvTZDdXeo=.
Differences from Azure
WARNING
SAS signatures are not verified by default. The token is parsed for key name, scope and expiry, and any credentials, or none, are accepted.
- Subscription SQL and correlation filter rules are accepted but discarded. There is no rules endpoint. Every subscription behaves as
TrueFilter. ListQueues,ListTopicsandListSubscriptionsignore$skipand$top.- AMQP bodies are flattened.
amqp-valueand sequence bodies are stored as bytes and returned as a data section. Application property types become strings after a persistence restore or when set through REST. - Client dead-letter and
PeekMessagesuse emulator-specific REST shapes:DeadLetterReasoninBrokerPropertieson the unlockPUT, andGET .../messages. The AMQP plane does both natively. - AMQP limits: 64 KiB frames, 1 MiB messages.
- AMQP transactions, resume of unsettled state across reconnects, WebSocket transport and SASL EXTERNAL are not implemented.
See also the service parity audit and AZURE.md.
Parity & Coverage
| Metric | Value |
|---|---|
| PARITY entries audited | 25 (22 ok, 3 partial) |
| Feature families | 10 (8 ok, 1 partial, 1 deferred) |
| Known gaps | 4 |
| Deferred items | 4 |
| Resource leaks | clean |
Known Gaps
- Subscription rules are not modeled: SqlFilter/CorrelationFilter in CreateSubscription bodies are discarded, there is no /subscriptions/<name>/rules route, and every subscription behaves as TrueFilter (handler.go createSubscription).
- AMQP bodies are flattened: amqp-value and sequence bodies are stored as bytes and returned as a data section; application property types survive in memory but are strings after a persistence restore or when set through REST.
- AMQP transactions, resume of unsettled state across reconnects, WebSocket transport and SASL EXTERNAL are not implemented (no transaction coordinator in amqp_*.go).
- List Queues/Topics/Subscriptions ignore $skip/$top and return every entity in one page.
Deferred Items
- Initial implementation pass (2026-09-06): seeded this service from scratch per AZURE.md M5 (see AZURE.md section 9). Structurally mirrors services/azurequeue's pop-receipt/visibility-timeout pattern for message locks and services/sns's topic/subscription fan-out bookkeeping; no prior audit history to reconcile.
- Follow-up pass (2026-09-07): closed five bounded parity gaps -- per-entity LockDuration/MaxDeliveryCount/DefaultMessageTimeToLive, PeekLock long-poll, full Atom+XML entity-kind parsing, and Get/List operations. Left the explicit client-initiated DeadLetter gap as-is after research found the wire shape unconfirmed (see gaps above); SQL-filter evaluation, sessions remained deferred per AZURE.md section 9.
- Sessions pass (2026-10-20): RequiresSession entities, session-filter receivers with locks, session state, renew-session-lock, FIFO per session, persisted in the snapshot.
- AMQP 1.0 pass (2026-10-20): added pkgs/amqp1 and the AMQP listener (plain 5672, TLS 5671) over the shared backend, with Defer, ReceiveDeferred, RenewLock, scheduled enqueue/cancel and lock-token lookup added to the backend; verified with the real azservicebus client.
Audited Operations
25 audited operations
| Operation | Wire | Errors | State | Persist |
|---|---|---|---|---|
CreateQueue | ok | ok | ok | ok |
DeleteQueue | ok | ok | ok | ok |
GetQueue | ok | ok | ok | n/a |
ListQueues | ok | ok | ok | n/a |
CreateTopic | ok | ok | ok | ok |
DeleteTopic | ok | ok | ok | ok |
GetTopic | ok | ok | ok | n/a |
ListTopics | ok | ok | ok | n/a |
CreateSubscription | ok | ok | ok | ok |
DeleteSubscription | ok | ok | ok | ok |
GetSubscription | ok | ok | ok | n/a |
ListSubscriptions | ok | ok | ok | n/a |
SendMessage | ok | ok | ok | ok |
PeekLockMessage | ok | ok | ok | n/a |
CompleteMessage | ok | ok | ok | ok |
AbandonMessage | ok | ok | ok | ok |
DeadLetter | partial | ok | ok | ok |
PeekMessages | partial | ok | ok | n/a |
ReceiveAndDeleteMessage | ok | ok | ok | ok |
AMQPSend | ok | ok | ok | ok |
AMQPReceive | ok | ok | ok | n/a |
AMQPSettle | ok | ok | ok | ok |
AMQPManagement | ok | ok | ok | ok |
AMQPSession | ok | partial | ok | ok |
AMQPAuth | ok | ok | ok | n/a |
Audited Feature Families
| Feature Family | Status |
|---|---|
sdk_compat | ok |
entity_kind_detection | ok |
filter_evaluation | deferred |
sessions | ok |
amqp_transport | ok |
lock_duration_and_long_poll | ok |
dead_lettering | ok |
auth | partial |
routing_isolation | ok |
observability | ok |
