Azure Service Bus vs Event Hubs: A 2026 Decision Guide

Azure Service Bus vs Event Hubs: A 2026 Decision Guide

Azure Service Bus vs Event Hubs: A 2026 Decision Guide

Last Updated: November 2026

Pick the wrong one of these two services and you will feel it in production, usually when a downstream consumer starts failing. You discover that the platform you chose has no concept of a poison message, or that you are paying for capacity sized for millions of telemetry events while moving a few hundred commands an hour. The azure service bus vs event hubs question is not a feature beauty contest. It is a decision about what kind of data you are moving and what guarantees you owe the rest of the system.

Service Bus is enterprise messaging built for discrete units of work that must be processed reliably, and often in order. Event Hubs is an event-streaming log built to absorb very high volumes of telemetry and let many independent readers replay it at their own pace. Both speak AMQP and both sit between producers and consumers, which is why teams confuse them. Their semantics, failure behaviour and cost curves diverge sharply once you leave the prototype.

By the end you will have a rule that picks the right service in under a minute, the numbers that justify it, and a pattern for using both together.

What this covers: the architectural distinction, delivery and ordering semantics, dead-lettering, verified limits by tier, scaling and cost models, a per-workload decision matrix, production gotchas, and when to deploy both.

Context and Background

Azure ships three first-party messaging services, and conflating them is the most common source of mis-architected event-driven systems. Service Bus is a brokered queue and publish-subscribe system. Event Hubs is a partitioned, append-only log. Event Grid, the third, is a push-based router for discrete notifications such as “a blob was created.” This guide concentrates on the first two, because those are the ones teams actually mix up, and touches Event Grid where it changes the answer.

The mental model that separates them is consumption. In Service Bus a message is consumed: a worker takes ownership under a lock, processes it, and settles it. Once completed, the message is gone from the queue. That is the right shape for commands and work items such as “charge this card,” “render this invoice” or “provision this tenant.” Each must happen reliably, and each needs a defined path for what happens when it cannot.

Event Hubs has the opposite shape. Producers append events to partitions, the events are retained for a configured window regardless of who has read them, and each consumer tracks its own position through offsets and checkpoints. Nothing is consumed in the Service Bus sense. Ten consumer groups can read the same firehose of clickstream or sensor data independently, and a new consumer can rewind and replay history. Apache Kafka users will recognise this immediately, and Event Hubs exposes a Kafka-compatible endpoint for Kafka 1.0 and later clients, per the Event Hubs features documentation.

Service Bus speaks AMQP 1.0 as its primary protocol, an ISO/IEC standard, plus HTTP/REST, and supports JMS 2.0 on the Premium tier. If you want the wire-level story behind that, see our AMQP protocol complete guide. Microsoft’s own Service Bus overview lists the broker features this post leans on: sessions, dead-lettering, scheduled delivery, deferral, transactions, filters and duplicate detection.

Why does this keep going wrong? Because the two services look interchangeable in a diagram. A box labelled “queue” sits between a producer and a consumer, and either product will move bytes between them on day one. The difference only shows when you need one of the following: a retry policy with a quarantine for bad messages, strict ordering per customer, replay of last Tuesday’s events, ten teams reading the same stream, or a bill that does not scale with message count. Each of those is a property of one service and an absence in the other.

A useful way to frame the rest of this guide is by asking four questions of any message flow. Is each item a task someone must complete, or a fact someone may want to analyse? Who owns the read position, the broker or the consumer? What happens to an item that fails repeatedly? And does the flow need to be replayed? The answers map almost mechanically onto the two products, and the sections below show why.

If you are building on the Azure IoT side, the closely related decision between IoT Hub and Event Hubs is covered in our IoT Hub vs Event Hubs architecture comparison, and the raw limits table lives in the companion Service Bus vs Event Hubs specifications post.

The Core Distinction: A Work Queue Versus a Replayable Log

Short answer: choose Service Bus when each message is a unit of work that one consumer must process reliably, possibly in order, with retries and a dead-letter queue. Choose Event Hubs when you ingest high-volume events that many consumers read independently and may need to replay. Service Bus tracks delivery state per message; Event Hubs tracks nothing per message and leaves the read position to the consumer.

Azure Service Bus vs Event Hubs: queue and topic delivery with peek lock and dead-letter queue

Figure 1: Service Bus holds per-message state. A worker takes a lock, then completes, abandons or dead-letters the message. Topics fan a copy out to each subscription.

Figure 1 shows the broker side. A producer sends to a queue; the broker stores the message durably and hands it to one worker under a peek-lock. The worker settles it with complete (done, remove it), abandon (release the lock so it is redelivered), defer (set aside for later retrieval by sequence number) or dead-letter (quarantine). A topic adds publish-subscribe: each subscription receives its own copy of matching messages, and rules on the subscription filter what it sees. The state that makes all of this possible, such as lock, delivery count and settlement, lives in the broker, and that is both the source of its guarantees and the reason its throughput ceiling is lower.

Service Bus: the broker owns delivery

In peek-lock mode the service holds an exclusive lock so other receivers cannot see the message. Per Microsoft’s settlement documentation the default lock duration is one minute and the maximum is five minutes, and the lock owner can extend it with a renewal call or automatic lock renewal. If the receiver crashes, the lock expires and the message is redelivered, with the delivery count incremented. After the default max delivery count of 10 the message moves to the dead-letter queue (DLQ) with the reason MaxDeliveryCountExceeded.

The alternative receive mode, receive-and-delete, treats the message as settled the moment the broker puts it on the wire. If the transfer fails, the message is lost. It suits low-value or short-lived data only.

This design gives you three things Event Hubs does not: per-message retry, quarantine of bad messages, and optional atomic work across operations on an entity. It also imposes a duty. Delivery is effectively at-least-once, so handlers must be idempotent. If a completion call fails after minutes of processing, the message comes back, and your code must decide whether the work was already done.

Event Hubs: the consumer owns the position

Azure Service Bus vs Event Hubs: partitioned log with consumer groups, checkpoints and Capture

Figure 2: Event Hubs appends events to partitions chosen by a partition-key hash. Each consumer group keeps its own checkpoints, and Capture archives the stream to storage.

Figure 2 shows the log side. A partition is an ordered sequence of events with new events appended to the end, and each event carries an offset and sequence number. A publisher may supply a partition key; Event Hubs runs it through a static hash to choose the partition, so events with the same key stay together in arrival order. Without a key, events are assigned round-robin. Ordering is guaranteed within a partition, not across the whole event hub, and the documentation is candid that demanding absolute ordering across everything limits how many partitions you can use.

A consumer group is an independent view of the stream. Every event hub has a $Default group, and the guidance is to create one per application: analytics, archival, alerting. Each group tracks its own position through checkpoints, which with AMQP are the consumer’s responsibility. The Azure SDK event processor clients handle partition load balancing and checkpointing, typically to Blob Storage. Microsoft recommends a separate container per consumer group and advises disabling hierarchical namespace, soft delete and versioning on the checkpoint account.

Because the broker records no per-message state, there is no dead-letter queue, no per-message lock and no settlement. If a consumer cannot process an event it must skip, park or retry it itself, and it must do so without blocking the partition behind it. This is the single biggest behavioural difference, and we return to it in the failure modes.

The delivery contract in one table

Property Service Bus Event Hubs
Unit of delivery One message to one consumer (per subscription) A position in a partition read by many groups
State kept by Broker, per message Consumer, as a checkpoint
Read effect Message removed on completion Event retained until retention expires
Failure handling Retry, defer, dead-letter queue Consumer-implemented
Ordering FIFO via sessions Per partition, via partition key
Replay Not native Native within retention
Typical payload Commands, orders, workflow steps Telemetry, logs, clickstream

The table is the whole post compressed, and everything after it is evidence.

Why the state difference sets the throughput ceiling

Per-message state is expensive. A broker that locks, counts and settles each message does more work per message than a log that appends bytes and lets readers pull ranges. That is why Event Hubs scales by adding partitions and throughput units until it absorbs millions of events per second, while Service Bus scales by messaging units and sheds work to concurrency across entities. The result is a pragmatic rule: if the dominant cost of a failure is a lost task, you want the broker’s state; if the dominant cost is a missed insight in a flood of data, you want the log’s throughput.

It also explains the retention models. A Service Bus message lives until completed, expired by its time-to-live, or dead-lettered, so its lifetime is a function of business logic. An Event Hubs event lives for a fixed window, one hour by default and up to 7 days on Standard or 90 days on Premium and Dedicated, regardless of whether anyone read it. Events cannot be explicitly deleted; retention changes apply to existing events. For long-term storage the documented answer is Capture, which writes the stream to Blob Storage or Azure Data Lake Storage in Avro, or Parquet via the portal’s no-code editor, on a size and time window you set.

Partitioning means different things in each service

Both services use the word partition, and the shared word hides a real difference. In Event Hubs a partition is the unit of parallelism and ordering: one active reader per partition within a consumer group is the standard model, so the partition count is your ceiling on consumer concurrency. Up to five non-epoch receivers can read the same partition at once, but they all receive the same events and gain no throughput. On Standard, the partition count cannot be changed after creation; Premium and Dedicated can increase it but never decrease it. Partition count does not affect price, which depends on throughput, processing or capacity units, so there is little reason to under-provision partitions you may need later.

In Service Bus, partitioning is a storage and availability feature rather than a consumer-parallelism one. Basic and Standard partitioned entities use 16 partitions each and are capped at 100 partitioned entities per namespace. Premium uses namespace-level partitioning with 1, 2 or 4 partitions fixed at namespace creation, and the messaging-unit count must be a multiple of the partition count. Consumer concurrency in Service Bus comes from competing consumers on a queue, not from partitions.

Deeper Analysis: Ordering, Failure Handling, Limits and Cost

The core distinction predicts behaviour, but production decisions turn on specifics. This section walks through ordering, the lifecycle of a failing message, the verified limits by tier, and how each service is billed and scaled.

Ordering: sessions versus partition keys

Both services can give you ordering, but they scope it differently. Service Bus provides first-in-first-out per session. A sender stamps each message with a session ID, for example a customer or order ID, and a receiver accepts the session and gets that session’s messages in order while other receivers work on other sessions. This gives ordered processing without serialising the whole queue. Session state also lets a worker keep a small blob of progress with the session; the quota is 1,000,000 session states per queue or subscription.

Event Hubs gives you order per partition. If you set the partition key to the device or account ID, all events for that key land in one partition in arrival order. The catch is that a hot key makes a hot partition, and because only one reader per consumer group owns the partition, a slow handler for one key delays every other key hashed to the same partition. Service Bus sessions do not have this head-of-line coupling across unrelated sessions, because a session is the lock scope and each session is picked up independently.

The practical rule: if “order within a customer” is a correctness requirement for a task, such as applying ledger entries or state-machine transitions, sessions are the safer fit. If order matters only for analysis, such as a time series per device, partition keys are ideal and cheaper.

The life of a failing message

Azure Service Bus vs Event Hubs: message lifecycle from lock to dead-letter queue

Figure 3: a message that keeps failing is redelivered until the delivery count is exhausted, then lands in the dead-letter queue where an operator or tool can inspect and resubmit it.

Figure 3 is the sequence that Event Hubs has no equivalent for. The sender sets a MessageId. The broker delivers the message under a lock. The worker either completes it or fails; failure by abandon, or by letting the lock expire, increments the delivery count and returns the message for redelivery. At the maximum delivery count the broker moves it to the DLQ. Microsoft documents the system reasons as MaxDeliveryCountExceeded, TTLExpiredException, HeaderSizeExceeded, MaxTransferHopCountExceeded (the forwarding hop limit is 4) and a null session ID on a session-enabled entity. Applications can also dead-letter explicitly with their own reason code and properties, which is the right move when retrying cannot help, for instance a schema violation.

Operationally, the DLQ is a sub-queue addressed as <queue path>/$deadletterqueue, or under the subscription path for topics. In the .NET SDK you open a receiver with SubQueue = SubQueue.DeadLetter rather than building the path. A DLQ does not have its own DLQ: you cannot dead-letter a message from a dead-letter queue. That means DLQ processing needs its own alerting and an owner, or it silently becomes a graveyard.

// Illustrative handler: settle explicitly, dead-letter what retries cannot fix
ServiceBusReceivedMessage msg = await receiver.ReceiveMessageAsync();
try
{
    await HandleAsync(msg);                    // must be idempotent
    await receiver.CompleteMessageAsync(msg);
}
catch (TransientFault)
{
    await receiver.AbandonMessageAsync(msg);   // delivery count + 1, retry
}
catch (InvalidPayload ex)
{
    await receiver.DeadLetterMessageAsync(msg, "InvalidPayload", ex.Message);
}

Two subtleties catch people. First, settle while the receiver and connection are still open; if you close the receiver first, the settlement never reaches the service, the lock expires and the message is redelivered. Second, deferred messages are not purged or dead-lettered on expiry by design, so a deferral without a retrieval plan leaks messages.

Duplicates. Service Bus offers duplicate detection on Standard and Premium, not Basic. It records the application-set MessageId of every message sent during the detection window, default 10 minutes, minimum 20 seconds, maximum 7 days. A resend with a logged ID succeeds from the sender’s perspective but is silently dropped. With partitioning enabled, uniqueness is MessageId plus PartitionKey. Larger windows reduce throughput, so keep the window as small as retries allow. Set deterministic IDs from business context, such as order number plus subject, not random GUIDs, or detection has nothing to match. This protects the send side only; the receive side still needs idempotent handlers because of at-least-once delivery. For the equivalent discussion on the Kafka side, see our post on Kafka exactly-once semantics and idempotent producers.

Verified limits by tier

These figures come from Microsoft’s quota pages for Service Bus and Event Hubs, checked in November 2026. Quotas change, so confirm before you commit a design.

Limit Service Bus Standard Service Bus Premium
Max message size 256 KB Default 1 MB, up to 100 MB over AMQP
Queue or topic size 1-5 GB, up to 80 GB partitioned 80 GB
Namespace size 400 GB 1 TB per messaging unit
Queues and topics per namespace 10,000 1,000 per MU, up to 16,000
Subscriptions per topic 2,000 2,000
Concurrent AMQP connections 5,000 5,000
Operations per second 1,000 (Basic and Standard) No fixed limit, depends on MUs
Limit Event Hubs Basic Standard Premium Dedicated
Max event size 256 KB 1 MB 1 MB 20 MB
Max retention 1 day 7 days 90 days 90 days
Partitions per event hub 32 32 100 1,024
Consumer groups per hub 1 20 100 1,000
Capacity unit TU, max 40 TU, max 40 PU, max 16 CU, max 10

Per throughput unit on Basic and Standard, ingress is 1 MB per second or 1,000 events per second, whichever comes first, and egress is 2 MB per second or 4,096 events per second. Premium and Dedicated have no fixed per-unit figure; throughput depends on resource allocation, partitions and storage. Per-partition guidance is roughly 1 MB per second in and 2 MB per second out on Standard, and 1-2 MB per second in and 2-5 MB per second out on Premium and Dedicated.

Read these tables for shape, not just numbers. Service Bus caps what you can do per entity and per connection; Event Hubs caps bytes per second. A flow of 5,000 tiny commands per second can stress a Standard Service Bus namespace’s 1,000 operations per second budget while using a trivial fraction of one Event Hubs throughput unit’s byte capacity, though event-rate limits apply there too. Conversely, a 2 MB telemetry batch does not fit Service Bus Standard at all.

Scaling and cost models

The two products bill on different axes, which is the root of most “we overpaid” stories.

  • Service Bus Standard is pay-as-you-go: a shared-capacity namespace billed per operation (plus a base charge), with variable throughput and latency because neighbours share the infrastructure. Premium is fixed price per messaging unit, with CPU and memory isolation. Premium bills hourly on the highest MU count allocated in that hour, so scaling down within the hour does not reduce that hour’s charge. Microsoft’s guidance is to start with 1 or 2 MUs, or one MU per partition, scale up when CPU exceeds 75% or memory exceeds 60%, and consider scaling down below 25% CPU.
  • Event Hubs Standard bills hourly per throughput unit plus ingress per million events; Capture is an extra charge per hour. Premium bills per processing unit with ingress included, 1 TB of retention storage per PU and Capture included. Dedicated bills per capacity unit with 10 TB included per CU. Basic and Standard TUs support auto-inflate to raise capacity automatically up to a ceiling you set.

I have deliberately not quoted hourly dollar rates: the Azure pricing page did not expose them in a form I could verify for this edit, so treat any per-hour figure you see elsewhere as unverified until you check the calculator for your region. The one USD figure confirmed on the page is geo-replication data transfer for Premium and Dedicated Event Hubs: $0.09 per GB in zone 1 (North America and Europe), $0.12 in zone 2 and $0.23 in zone 3.

The cost-shape insight is more durable than the rates. Event Hubs has a floor: you pay for provisioned units whether or not traffic arrives, so tiny workloads are relatively expensive per event. Service Bus Standard has near-zero idle cost but per-operation cost that grows linearly with message count, so extremely chatty flows get expensive. Premium on both sides trades a higher fixed floor for predictability and isolation. Model your steady-state message rate, peak factor and message size before choosing a tier; the cheapest tier at 100 messages per second is rarely the cheapest at 10,000.

Decision Matrix: Which Service for Which Workload

Azure Service Bus vs Event Hubs decision flow for choosing a messaging service

Figure 4: a decision flow. The first question is whether each item is a unit of work; replay and fan-out push you to Event Hubs, and the combined pattern covers flows that need both.

Figure 4 encodes the rule of thumb in order of the questions that actually decide cases. Start with whether each item is a task that someone must complete. If yes and you need dead-lettering, sessions or transactions, it is Service Bus. If the item is a fact in a flood, and you need replay or several independent readers, it is Event Hubs. If you only need to notify subscribers that something happened, with push delivery and filtering, Event Grid is lighter than either. The bottom branch is the pattern most mature systems end up with: Event Hubs for the raw stream, a router that selects actionable events, and Service Bus for the work those events trigger.

Workload Best fit Why
Order placement, payment, provisioning commands Service Bus Per-message retry, DLQ, duplicate detection, optional transactions
Per-customer ordered processing (ledger entries) Service Bus with sessions FIFO scoped to a session, no cross-key head-of-line blocking
Pub-sub fan-out with per-subscriber filters Service Bus topics Each subscription gets its own copy; SQL and correlation filters
IoT telemetry from thousands of devices Event Hubs Throughput, partition-key ordering per device, retention and replay
Clickstream, logs, metrics pipelines Event Hubs Many consumer groups, Capture to storage, Kafka clients work unchanged
Stream processing and analytics Event Hubs Log semantics suit windowing and reprocessing
Delayed or scheduled actions Service Bus Scheduled delivery and TTL are first-class
Legacy Java or JMS applications Service Bus Premium JMS 2.0 support; Standard offers only a JMS 1.1 queue subset
Very large payloads, up to 100 MB Service Bus Premium Over AMQP; Event Hubs tops out at 20 MB on Dedicated
Reacting to Azure resource changes Event Grid Push delivery with filtering and minimal infrastructure

Treat the table as a default, then test it against your own constraints. A few illustrative cases show where it bends.

IoT command and control. Device telemetry goes to Event Hubs, because it is high-volume and replayable. A command back to a device, “reboot,” “update firmware,” is a unit of work with a retry policy and a failure path, so it belongs in a Service Bus queue or in IoT Hub’s cloud-to-device channel. Putting commands onto the telemetry stream works until a device misses one and nobody can tell.

Order pipeline with analytics. Orders flow through Service Bus because each must be processed once and failures need quarantine. The same order events are also published to Event Hubs so analytics, fraud models and a data lake can read them without touching the transactional path. Notice that the two flows have different SLAs and different consumers, which is the reason for two services rather than one.

Microservice integration events. Many teams use Service Bus topics for domain events between services. That works well when subscribers need individual retry and DLQ behaviour. It becomes awkward when the event rate climbs into the tens of thousands per second or when new consumers need history; at that point an Event Hubs log, or Kafka, is the better substrate. Our comparison of Kafka, RabbitMQ and SQS for task queues makes the same queue-versus-log argument outside Azure.

Edge and industrial telemetry. If you ingest from many sites and need replay, the log model wins, and the same trade-off appears in NATS JetStream versus Kafka for edge IIoT telemetry. Where the stream lands in a store matters too; see Azure time-series databases and Data Explorer for the downstream half.

The combined pattern in practice

The “both” pattern deserves a precise description because it is easy to implement badly. Event Hubs receives everything. A processing stage, an Azure Function, Stream Analytics job or a consumer in your own service, reads a consumer group, evaluates each event, and for the small fraction that requires action, writes a command message to a Service Bus queue or topic. The command carries a deterministic MessageId derived from the event’s identity, so a replayed or reprocessed event does not double-fire the action when duplicate detection is on.

Two properties make this robust. The Event Hubs checkpoint is advanced only after the Service Bus send succeeds, which gives at-least-once between the stages, and duplicate detection plus idempotent handlers turn that into effectively-once outcomes. And the two failure domains stay separate: a stuck action consumer fills a Service Bus queue and raises a DLQ alert, while the telemetry pipeline keeps flowing. If the action path were on the same log, one slow handler would delay unrelated analytics.

If you run consumers on Kubernetes, scaling them from either source is straightforward with event-driven autoscalers; our KEDA event-driven autoscaling architecture post covers scaling on Service Bus queue length and on Event Hubs lag.

Migration directions

Teams sometimes outgrow a first choice. Moving work queues from Event Hubs to Service Bus is usually driven by the pain of hand-built retry and parking-lot logic; the migration is mostly a change of consumer contract, and you should plan it around idempotency. Moving from Service Bus to Event Hubs is driven by volume or by the need for replay and multiple readers; the hard part is that you lose per-message settlement, so you must rebuild failure handling inside the consumer. If you already run Apache Kafka, Event Hubs’ Kafka endpoint lets existing producers and consumers point their bootstrap server at the namespace, with a unique group.instance.id per consumer instance (static membership) recommended to reduce needless rebalancing.

Trade-offs, Gotchas, and What Goes Wrong

Poison events in a log. On Event Hubs, one event that your consumer cannot parse will, if you retry it forever, stall the partition behind it. If you skip it silently, you lose data. The fix is to build your own parking lot: catch the failure, write the event and its coordinates (partition, offset) to a side store or a Service Bus queue, then checkpoint past it. This is the single most common hidden cost of choosing Event Hubs for work that turns out to need failure handling.

Checkpoint design. Checkpointing after every event hammers Blob Storage and slows the consumer; checkpointing rarely widens the replay window after a crash. Pick an interval tied to how much reprocessing you can tolerate, and make handlers idempotent either way. Sharing a checkpoint container with other data, or leaving soft delete and versioning on, is documented as a source of trouble.

Lock expiry on slow handlers. In Service Bus, if processing takes longer than the lock duration, the lock expires, the message is redelivered to another worker, and your first worker’s completion fails. You then run the work twice. Set the lock above normal processing time up to the five-minute maximum, use automatic lock renewal for long jobs, and never rely on the lock as a mutex. A very long lock has a cost too: a crashed worker leaves the message invisible until the lock runs out.

Dead-letter neglect. The DLQ does not alert anyone by default. Add a metric alert on dead-letter message count and a runbook for inspect, fix and resubmit. Also remember that TTL expiry only dead-letters if dead-lettering on expiry is enabled on the entity; otherwise expired messages vanish.

Fixed partition counts. On Event Hubs Standard you cannot change the partition count after creation, and on Premium and Dedicated you can only increase it. Provision for peak consumer parallelism, not today’s need; since partition count does not affect price, over-provisioning is cheap insurance. In Service Bus Premium, partition count is likewise fixed at namespace creation, to 1, 2 or 4.

Hot partitions and skewed keys. A partition key with a heavy hitter, say one giant tenant, pins most traffic to one partition, which is capped at roughly 1-2 MB per second in. Measure key distribution before choosing the key, and consider a composite key such as tenant plus a bounded shard number when strict per-tenant order is not required.

Receive-and-delete data loss. Receive-and-delete mode in Service Bus is faster, but a failure between delivery and processing loses the message. Use it only for data you can afford to drop.

Standard-tier noisy neighbours. Service Bus Standard shares capacity, so latency and throughput vary. If a workload needs predictable latency, isolation, private networking or customer-managed keys, that is Premium’s job; the documentation also notes that express entities are not supported on Premium, so disable that feature when migrating.

Unverified portability assumptions. Do not assume features carry across tiers. Event Hubs Capture is paid on Standard and included in Premium and Dedicated; Basic Event Hubs has one consumer group and one-day retention. A design that works on Premium may need redesign at Standard.

Practical Recommendations

Start from the unit of data, not the product. If a message represents a task with an owner and a consequence for failure, put it on Service Bus. If it represents an observation that many parties may analyse, possibly later, put it on Event Hubs. When one flow contains both, split it at the point where an observation becomes an instruction, and put a deterministic message ID on that boundary.

For tiers, prototype on Standard, but decide early whether production needs Premium. The triggers are concrete: payloads above 256 KB on Service Bus, JMS 2.0, private networking at the namespace level, geo-replication, customer-managed keys, or latency that must stay predictable. On Event Hubs the triggers are retention beyond 7 days, more than 20 consumer groups, more than 32 partitions, or events above 1 MB. Size from measured rates: peak events per second, average and maximum event size, and the number of independent readers.

Treat idempotency as a requirement, not a feature. Both services can redeliver, so handlers should tolerate repeats regardless of which one you pick. Finally, instrument the failure paths before the happy path: DLQ depth, oldest message age, consumer lag per partition and checkpoint age are the signals that tell you something is wrong before customers do.

  • [ ] Classify each flow as command, event or notification before choosing a service.
  • [ ] Set deterministic MessageId values and enable duplicate detection where sends can be retried.
  • [ ] Choose Event Hubs partition counts for peak consumer parallelism; remember Standard cannot change them later.
  • [ ] Pick partition keys by measured distribution, not by what is convenient.
  • [ ] Alert on DLQ count, lock-lost exceptions, consumer lag and checkpoint age.
  • [ ] Build a parking lot for poison events on any Event Hubs consumer that must not stall.
  • [ ] Verify current limits and pricing for your region before sign-off.
  • [ ] Load-test at 2x expected peak, including a consumer-failure scenario.

Frequently Asked Questions

What is the main difference between Azure Service Bus and Event Hubs?

Service Bus is a message broker: it stores each message, locks it to one consumer, and tracks settlement, so you get retries, dead-lettering, sessions and transactions. Event Hubs is a partitioned event log: it appends events, retains them for a window, and lets each consumer group track its own offset. Choose Service Bus for units of work and Event Hubs for high-volume streams that many readers analyse or replay.

Can Event Hubs replace Service Bus or the reverse?

Only for narrow cases. Event Hubs lacks per-message locks, a dead-letter queue and scheduled delivery, so using it for tasks forces you to rebuild failure handling in consumers. Service Bus lacks replay and its operation limits and per-message state make very high telemetry volumes costly or impractical. Replacement works when requirements are simple; once you need both retry semantics and stream throughput, use each for what it does well.

Which service is cheaper?

It depends on volume and shape. Event Hubs has a capacity floor in throughput, processing or capacity units, so small workloads cost more per event but large ones are very efficient. Service Bus Standard has little idle cost but bills per operation, so chatty flows grow expensive; Premium is a fixed price per messaging unit. I have not verified current hourly rates, so check the Azure pricing calculator for your region.

Does Event Hubs guarantee ordering?

Within a partition, yes. Events sharing a partition key are hashed to the same partition and keep arrival order, but there is no ordering guarantee across partitions or across the event hub as a whole. If you need global order you must use one partition and accept its throughput ceiling. Service Bus offers per-session FIFO, which scopes ordering to a session ID without a global bottleneck.

Does Event Hubs support Kafka clients?

Yes. Event Hubs exposes a Kafka-compatible endpoint for Kafka version 1.0 and later, for both producing and consuming, so existing applications generally work by pointing the bootstrap server at the namespace and adjusting authentication settings. Setting a unique group.instance.id per consumer instance reduces unnecessary rebalancing. It is not a full Kafka cluster, so features outside the supported protocol surface may differ; test your specific client libraries.

What happens to messages that fail repeatedly in Service Bus?

Each failed attempt, whether an abandon or a lock expiry, increments the delivery count. By default, after 10 attempts the message moves to the dead-letter queue with the reason MaxDeliveryCountExceeded. Messages can also be dead-lettered explicitly, or when their time-to-live expires if dead-lettering on expiry is enabled. You inspect the DLQ with a receiver on the dead-letter sub-queue and resubmit after fixing the cause.

Further Reading

By Riju — about

1 Comment

Leave a Reply

Your email address will not be published. Required fields are marked *