Skip to content

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:

text
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:

bash
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) ​

AreaOperations
QueuesCreateQueue, DeleteQueue, GetQueue, ListQueues
TopicsCreateTopic, DeleteTopic, GetTopic, ListTopics
SubscriptionsCreateSubscription, DeleteSubscription, GetSubscription, ListSubscriptions
MessagesSendMessage (metadata in the BrokerProperties header), PeekLockMessage, ReceiveAndDeleteMessage, PeekMessages, CompleteMessage, AbandonMessage, DeadLetterMessage
  • Queue vs topic is detected from the Atom+XML body root (QueueDescription or TopicDescription), or from ?type=topic.
  • LockDuration, MaxDeliveryCount and DefaultMessageTimeToLive are per entity.
  • PeekLock honours a long-poll timeout, capped at 30 s.
  • A janitor (10 s) releases expired locks, dead-letters on MaxDeliveryCount exhaustion 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.

FlagEnvDefaultPurpose
--azure-servicebus-portAZURE_SERVICEBUS_PORT10003REST port
--azure-servicebus-amqp-portAZURE_SERVICEBUS_AMQP_PORT5672Plain AMQP 1.0. 0 disables
--azure-servicebus-amqp-tls-portAZURE_SERVICEBUS_AMQP_TLS_PORT5671AMQP 1.0 over TLS, self-signed certificate. 0 disables
--azure-servicebus-validate-sasAZURE_SERVICEBUS_VALIDATE_SASfalseVerify 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, ListTopics and ListSubscriptions ignore $skip and $top.
  • AMQP bodies are flattened. amqp-value and 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 PeekMessages use emulator-specific REST shapes: DeadLetterReason in BrokerProperties on the unlock PUT, and GET .../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 ​

MetricValue
PARITY entries audited25 (22 ok, 3 partial)
Feature families10 (8 ok, 1 partial, 1 deferred)
Known gaps4
Deferred items4
Resource leaksclean

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
OperationWireErrorsStatePersist
CreateQueueokokokok
DeleteQueueokokokok
GetQueueokokokn/a
ListQueuesokokokn/a
CreateTopicokokokok
DeleteTopicokokokok
GetTopicokokokn/a
ListTopicsokokokn/a
CreateSubscriptionokokokok
DeleteSubscriptionokokokok
GetSubscriptionokokokn/a
ListSubscriptionsokokokn/a
SendMessageokokokok
PeekLockMessageokokokn/a
CompleteMessageokokokok
AbandonMessageokokokok
DeadLetterpartialokokok
PeekMessagespartialokokn/a
ReceiveAndDeleteMessageokokokok
AMQPSendokokokok
AMQPReceiveokokokn/a
AMQPSettleokokokok
AMQPManagementokokokok
AMQPSessionokpartialokok
AMQPAuthokokokn/a

Audited Feature Families ​

Feature FamilyStatus
sdk_compatok
entity_kind_detectionok
filter_evaluationdeferred
sessionsok
amqp_transportok
lock_duration_and_long_pollok
dead_letteringok
authpartial
routing_isolationok
observabilityok

Released under the MIT License.