Google Pub/Sub Alternatives: Eight Options On and Off Google Cloud
The main Google Pub/Sub alternatives come in four groups. Google's own options are Managed Service for Apache Kafka, for a replayable log, and Cloud Tasks, for work that has to run later or at a controlled rate. Kafka itself, Apache Pulsar, NATS JetStream and RabbitMQ are open-source systems that run anywhere. On the other clouds, the nearest equivalents are SNS feeding SQS queues on AWS and Service Bus topics on Azure. And Java services that already use Valkey or Redis can keep Pub/Sub's model of topics, subscriptions and per-message acknowledgements with Redisson PRO, without adding a broker.
Which one fits depends on what started the search and on how your system uses Pub/Sub today. Messaging between your own services can move to any of them. Push delivery to Cloud Run, exports to BigQuery and events that other Google services publish are tied to Pub/Sub, and that traffic usually stays where it is.
Redisson is our product, and it is option 8 below, limits included. We checked the Google Cloud details against Google's documentation and price lists on November 16, 2026, and the other products against their own documentation the same month.
Why Teams Look for a Google Pub/Sub Alternative
Google recommends Pub/Sub for new streaming workloads on Google Cloud, and for many teams it never needs replacing. The search for an alternative usually starts with one of these:
- The bill grows with every subscription. Pub/Sub bills $40 for every TiB of throughput beyond a free 10 GiB a month, and it counts a message once on publish and once more for every subscription that reads it. Each request is charged as at least 1 KB, and the messages a subscription's filter throws away are charged too. Google's price list puts a steady 10 MiB/s at about $2,000 a month with one subscription and $3,000 with two, so at that rate each consuming service adds roughly $1,000 a month.
- It runs only on Google Cloud. Pub/Sub has its own API, with client libraries for nine languages and no Kafka, AMQP, MQTT or JMS endpoint, so code written for it doesn't move. In Google's comparison with its Kafka service, Pub/Sub is the one marked as not running identically on other clouds. Local development has an emulator, but it keeps data only while it runs, doesn't support IAM or configurable retention, and accepts BigQuery subscriptions and single message transforms without acting on them.
- Messages can't wait or jump the queue. There is no scheduled delivery and no message priority, and the longest a retry policy can hold back a redelivery is 600 seconds. Google's comparison with Cloud Tasks marks scheduled delivery yes for Cloud Tasks and no for Pub/Sub.
- History ends at 31 days. Topics and subscriptions retain messages for at most 31 days, and a snapshot lasts at most 7, so Pub/Sub can't be the long-term record of what happened.
- Latency is in the region of a tenth of a second. Google puts Pub/Sub's end-to-end latency at "typically on the order of 100 milliseconds", against about 10 milliseconds for its managed Kafka. That is fine for most event flows, and too slow for a request that waits on the reply.
- Pub/Sub Lite is closing. Google's partitioned, lower-cost variant stopped taking new customers in September 2024 and will be turned down on January 31, 2027, so its users have to move. A section below covers where to.
First, Work Out What Pub/Sub Does for You
In most Google Cloud estates Pub/Sub does up to three jobs, and only the first moves easily.
Job 1: Messaging Between Your Own Services
Publishers send events to a topic, each consuming service has its own subscription, and the subscribers attached to a subscription share its messages and acknowledge them one at a time. Pub/Sub redelivers whatever isn't acknowledged, backs off between attempts and forwards a message that keeps failing to a dead-letter topic. Every alternative on this page can do this job; they differ in how much of the retry and dead-letter handling becomes your own code, which the table below shows.
Job 2: Serverless Plumbing on Google Cloud
Push subscriptions call an HTTPS endpoint, typically a Cloud Run service, for each message. Export subscriptions load messages into BigQuery tables or Cloud Storage files with no consumer of your own, Dataflow reads topics directly, and single message transforms reshape messages on the way through. Elsewhere, each of these becomes a connector, a function or code you run, so measure how much of your traffic travels this way before you estimate a move.
Job 3: Events From Other Google Services
Several Google products deliver their events through Pub/Sub. Cloud Storage notifications add a message to a Pub/Sub topic for each object change, log sinks can route logs to a topic, and the Gmail API sends its push notifications through Pub/Sub. Consumers of these events need Pub/Sub, or a bridge from it, whichever alternative you pick, so most plans leave this traffic where it is and move job 1 alone.
If jobs 2 and 3 carry most of your traffic, the reasons above may not justify a move; keeping Pub/Sub at the edges and changing only what runs between your services is often the better answer.
How Pub/Sub's Concepts Map to the Alternatives
Each alternative has its own name for a subscription and its own answer to a message that keeps failing. The table lines them up with Pub/Sub, leaving out Cloud Tasks, which has no subscriptions; the sections after it explain the details.
| Alternative | A Pub/Sub subscription becomes | Acknowledgements, retries and dead letters | Per-key order | Delay and priority | Replay |
|---|---|---|---|---|---|
| Google Pub/Sub, for reference | A subscription | Per message, under a 10-to-600-second ack deadline that client libraries extend; retry backoff up to 600 seconds; dead-letter topic after 5 to 100 attempts | Ordering keys, up to 1 MBps each | Neither | Seek to a time or a snapshot, within 31 days |
| Apache Kafka | A consumer group, or a share group from Kafka 4.2 | Consumer groups commit one offset per partition and leave retries to your code; share groups acknowledge each record and gained dead-letter topics in Kafka 4.4 | Per partition, chosen by the record key | Neither | Reset offsets anywhere in the topic's retention, which can be unlimited |
| Apache Pulsar | A subscription of type Shared or Key_Shared | Per message, with negative acknowledgements and an optional acknowledgement timeout; a dead-letter topic on Shared and Key_Shared subscriptions | Key_Shared subscriptions | Delayed delivery on Shared and Key_Shared; no priority | Seek to a message ID or a time, within retention |
| NATS JetStream | A durable consumer on a stream | Ack, nak with an optional delay, in-progress and terminate; redelivery after AckWait, 30 seconds by default; no dead-letter stream | Stream order; partition subjects by key to keep it across workers | Scheduled messages since NATS 2.12; no priority | Start from any sequence number or time still in the stream |
| RabbitMQ | A queue per consuming service, bound to an exchange | Ack, nack and reject; quorum queues apply a delivery limit, 20 by default, then a dead-letter exchange if one is set | Per queue, with a single active consumer | Native delays (4.4) and up to 32 priorities (4.3) on quorum queues | Streams only; a queue deletes what is acknowledged |
| Amazon SNS with SQS | An SQS queue subscribed to an SNS topic | A visibility timeout, 30 seconds by default and up to 12 hours; a redrive policy to a dead-letter queue | FIFO topics and FIFO queues, per message group | SQS delays of up to 15 minutes; no priority | SNS FIFO topics archive and replay messages for up to 365 days |
| Azure Service Bus | A topic subscription | Peek-lock, 1 minute by default and 5 at most, renewable; a dead-letter subqueue after 10 deliveries by default | Sessions | Scheduled messages; no priority | None; replay is Event Hubs' job |
| Redisson PRO Reliable PubSub | A subscription | Per message. A negative acknowledgement marks a message failed, to be redelivered after an optional delay, or rejected, which sends it straight to the dead-letter topic, or deletes it if there is none; 30-second visibility timeout and 10 delivery attempts by default | Message groups, though redeliveries within a group can come out of order | Delay per message; priority from 0 to 9 | Seek to a time or a message ID; history kept in memory |
The Eight Alternatives
Each option below suits a particular kind of team, and each section ends with the cases where it doesn't.
1. Apache Kafka, Including Google's Managed Service
Kafka is the alternative Google itself runs as a service. Managed Service for Apache Kafka reached general availability in November 2024 and runs open-source Kafka for you, with brokers spread over three zones, security patches applied by Google, and older log segments moved to tiered storage that Google describes as effectively unlimited. Sizing stays with you: vCPUs and memory per cluster, partitions per topic. Google's documentation names Kafka 3.7.1 as the cluster version and notes that minor versions aren't upgraded for you. Kafka Connect clusters come with connectors for BigQuery, Cloud Storage and Pub/Sub, and the schema registry is in preview. Google puts typical latency at around 10 milliseconds for consumers that keep up.
What you gain is a log. History stays for as long as you pay to store it, consumers replay it by resetting offsets, Kafka Connect, Kafka Streams and Flink are available, and the same code runs on any other Kafka: a cluster you operate, Confluent Cloud, Amazon MSK, or the Kafka endpoint of Azure Event Hubs. The cost is per-message acknowledgement: a consumer group commits one offset per partition, so retries and dead-letter topics become application code. Share groups acknowledge records one at a time, and gained dead-letter topics in Kafka 4.4, but they need a newer Kafka than the 3.7.1 Google documents. Kafka's capacity pricing usually beats Pub/Sub's per-byte charge at steady volume, while its smallest cluster costs more than Pub/Sub at low volume; Google Pub/Sub vs Kafka works through Google's estimates for both.
Wrong for you if: your traffic is low or bursty, you want retries and dead letters per message without writing them, or nobody on the team wants to plan partitions and capacity.
2. Cloud Tasks, for Work That Must Run Later
Cloud Tasks is Google's queue for jobs that have a single handler. Google's comparison calls the difference implicit versus explicit invocation: a Pub/Sub publisher doesn't know who will receive an event, while a Cloud Tasks producer names the endpoint that will run each task. That explicitness buys what Pub/Sub can't do. A task can be scheduled up to 30 days ahead, a named task is created only once, retry limits and backoff are set per queue, and the queue caps its dispatch rate so that a slow service downstream isn't flooded. A handler on an HTTP target has 30 minutes to respond, where a Pub/Sub push endpoint has 10.
The same design sets the limits. Each task has exactly one handler, so there is no fan-out; there is no pull API; a queue dispatches at most 500 tasks a second; tasks are limited to 1 MiB; and queues are regional. Pricing is per operation: the first million each month are free, then $0.40 per million, and every 32 KB of a task counts as one operation.
Eventarc also comes up, but as a router: Eventarc Standard triggers deliver Google Cloud events to Cloud Run, Workflows and other targets, and Eventarc Advanced, generally available since August 2025, adds a regional bus that filters, transforms and routes events between services.
Wrong for you if: several services need each message, your consumers need to pull messages, or one queue must dispatch more than 500 tasks a second. For delayed jobs that JVM workers process, Redisson PRO's Reliable Queue offers per-message delay and priority without the HTTP hop.
3. Apache Pulsar
Of the open-source systems, Pulsar's model is the closest to Pub/Sub's. A topic has named subscriptions, each with its own cursor, and the subscription type decides how its consumers share messages: Shared gives each message to one consumer, and Key_Shared keeps all messages with the same key on the same consumer, which plays the part of an ordering key. Consumers acknowledge messages individually or negatively acknowledge them for redelivery, an optional acknowledgement timeout reclaims messages that a consumer holds too long, and a dead-letter policy moves a message to a dead-letter topic after a set number of redeliveries. Producers can delay a message with deliverAfter or deliverAt, retention keeps acknowledged messages, and a consumer can seek its subscription back to a message ID or a timestamp.
Pulsar's messaging documentation spells out two limits that matter to Pub/Sub users. Delayed delivery and dead-letter topics work only on Shared and Key_Shared subscriptions. And the redelivery count behind negative acknowledgements is held in memory, so it resets when a broker restarts or a consumer disconnects, and the dead-letter limit may never be reached; the documentation recommends the retry letter topic, which stores the count in the message, when the limit must hold.
Pulsar 5.0, the new long-term support line released in October 2026, recommends Oxia as the metadata store for new clusters, adds scalable topics, and needs Java 21 on the servers. You still operate three tiers: brokers, BookKeeper storage nodes and the metadata store. StreamNative runs it as a managed service on AWS, Google Cloud and Azure. Apache Pulsar vs Reliable PubSub compares it with Redisson's model.
Wrong for you if: you are leaving Pub/Sub to run less infrastructure, or you need per-message priority, which Pulsar doesn't offer.
4. NATS JetStream
NATS is a small messaging server written in Go, and JetStream is its persistence layer. A stream stores the messages published on a set of subjects, and a durable consumer on the stream does a subscription's job: workers pull from it and acknowledge each message. A worker can also ask for redelivery, optionally after a delay, report that it is still working, which resets the acknowledgement timer, or terminate a message so it is never redelivered. Unacknowledged messages come back after the consumer's AckWait, 30 seconds by default, and keep coming back until MaxDeliver is reached, which by default is never. Consumers can start at any sequence number or time still in the stream, which gives you replay within the stream's limits.
Scheduling arrived recently: NATS 2.12, in September 2025, added delayed messages, and 2.14, in April 2026, added recurring schedules. A dead-letter stream is still missing. When a message reaches MaxDeliver the server publishes an advisory and stops redelivering it, and Synadia, the company behind NATS, suggests storing those advisories in a stream and copying the messages they point to into a dead-letter stream of your own. Synadia also runs NATS as a managed service. The server is a single binary under the Apache 2.0 licence, with clients for many languages.
Wrong for you if: you want dead letters, priorities or push to HTTPS endpoints without building them, or nobody wants to run a cluster.
5. RabbitMQ
RabbitMQ fits when routing and per-message features matter more than history. Producers publish to exchanges and bindings decide which queues get a copy, so a Pub/Sub subscription becomes a queue per consuming service, bound to a topic or fanout exchange. Quorum queues replicate each queue across nodes and dead-letter messages that keep failing, and RabbitMQ 4.3 and 4.4 gave them up to 32 priorities and native delayed delivery. Streams add replayable, log-style queues. RabbitMQ speaks AMQP 0-9-1 and 1.0, MQTT and STOMP, which matters once devices or services in other languages join.
Google Cloud doesn't offer RabbitMQ as a managed service. Teams there run it on GKE with the open-source Kubernetes cluster operator, or rent it from CloudAMQP through Google Cloud Marketplace. RabbitMQ alternatives covers its support windows and JMS routes, and ActiveMQ vs RabbitMQ walks through its redelivery rules.
Wrong for you if: you need long history or replay outside streams, or you want someone else to run the broker without signing up with a third party.
6. AWS: SNS With SQS, EventBridge or Kinesis
On AWS, Pub/Sub's work is split across services. The direct counterpart is an SNS topic with an SQS queue subscribed for each consuming service. SNS delivers every message to each queue, and consumers receive from their queue under a visibility timeout of 30 seconds by default and up to 12 hours, with a redrive policy that moves repeat failures to a dead-letter queue. SNS filter policies can match message attributes or, unlike Pub/Sub's filters, the message body. FIFO topics and queues add ordering per message group and deduplication, and FIFO topics can archive messages for up to 365 days and replay them to a subscription.
EventBridge is the bus for events from AWS services and SaaS applications, with content-based rules and an archive that can replay events, and Kinesis Data Streams is AWS's managed log, retaining data for between 24 hours and a year. SQS messages can be up to 1 MiB, as can SNS messages once the topic's limit is raised from its 256 KiB default, and SQS keeps a message for at most 14 days and delays it by at most 15 minutes. Amazon SQS vs Reliable Queue and Amazon Kinesis vs Reliable PubSub and Queue cover both in depth.
Wrong for you if: you are staying on Google Cloud, or you want fan-out, queueing and replay in one system. If every consumer runs on the JVM, Redisson PRO also works on AWS, with topics in MemoryDB or in ElastiCache for Valkey with synchronous durability turned on; see option 8.
7. Azure: Service Bus, Event Grid or Event Hubs
Microsoft's own comparison splits Azure messaging three ways: Event Grid routes events as they happen, Event Hubs takes in high-volume streams for analytics, and Service Bus carries transactional business messages. Service Bus topics are the closest to Pub/Sub. Each subscription receives a copy of every message, consumers settle messages under a peek-lock, and a message that reaches its maximum delivery count, 10 by default, moves to the subscription's dead-letter subqueue. It adds what Pub/Sub lacks: scheduled messages, sessions for ordered processing, and SQL filters on message properties that the broker evaluates. Messages can be up to 256 KB on the Standard tier and up to 100 MB on Premium.
Event Grid namespace topics are the other close match: subscribers pull CloudEvents and acknowledge, release or reject each one, much as Pub/Sub's pull subscribers do, but a namespace keeps events for at most 7 days. Event Hubs is Azure's log, retaining events for up to 7 days on Standard and 90 on Premium and Dedicated, with a Kafka endpoint on Standard and above. Azure Service Bus vs Reliable Queue and Reliable PubSub compares Service Bus with Redisson PRO, and Azure Service Bus alternatives compares it with Storage Queues, Event Hubs and Event Grid.
Wrong for you if: you are staying on Google Cloud or need the same system on several clouds. For JVM services, Redisson PRO also runs on Azure Managed Redis, the Redis Enterprise service replacing Azure Cache for Redis.
8. Redisson PRO on Valkey or Redis
Redisson, our Java client for Valkey and Redis, has an open-source edition and a commercial one, Redisson PRO. PRO adds Reliable PubSub, a topic object that works on Pub/Sub's principles. Every subscription gets its own copy of each message, consumers on one subscription split the work and acknowledge messages one by one, a message nobody acknowledges comes back once its visibility timeout runs out, and repeated failures send it to a dead-letter topic. There is no broker process. Topics live in the Valkey or Redis you already run, whether Memorystore for Valkey on Google Cloud, ElastiCache or MemoryDB on AWS, Azure Managed Redis, or your own servers, so the same code moves between clouds.
It answers several of the limits listed at the top. Each message can carry a delay and a priority from 0 to 9, publishing can drop duplicates by ID or payload hash, and a subscription can seek to a timestamp or a message ID with no 31-day ceiling. Memorystore bills by the node-hour, so another subscription adds memory and network load but no per-byte charge. The JVM section below rebuilds a Pub/Sub subscription in it and lists the limits.
Wrong for you if: any publisher or consumer isn't on the JVM, your backlog and history won't fit in memory, or you rely on push to HTTPS endpoints or exports to BigQuery.
Google Pub/Sub Equivalents on AWS and Azure
No single AWS or Azure service does everything Pub/Sub does. This table maps each Pub/Sub capability to the service that provides it on the other two clouds.
| Pub/Sub capability | AWS | Azure |
|---|---|---|
| Topic with independent subscriptions and per-message acknowledgement | An SNS topic delivering to one SQS queue per consuming service | A Service Bus topic and its subscriptions; Event Grid namespace topics with pull delivery |
| Push to an HTTPS endpoint | SNS HTTP/S subscriptions, or Lambda | Event Grid topics pushing to webhooks or Azure Functions |
| Events from the cloud's own services | EventBridge | Event Grid system topics |
| Filtering per subscription | SNS filter policies, on attributes or the message body | Service Bus SQL and correlation filters, on message properties |
| Per-key ordering | An SNS FIFO topic with FIFO queues, per message group | Service Bus sessions |
| Dead letters | An SQS redrive policy to a dead-letter queue | The subscription's dead-letter subqueue, after 10 deliveries by default |
| Delayed delivery (Pub/Sub has none) | SQS delays of up to 15 minutes | Service Bus scheduled messages |
| Retention and replay | SQS keeps messages up to 14 days; SNS FIFO archives and Kinesis Data Streams keep up to 365 days | Service Bus keeps messages until their time-to-live but doesn't replay them; Event Grid namespaces keep events up to 7 days; Event Hubs up to 90 |
| Largest message | 1 MiB on SQS; SNS 256 KiB by default, up to 1 MiB | 256 KB on Service Bus Standard, 100 MB on Premium; 1 MB on Event Grid |
| Kafka-compatible option | Amazon MSK | The Event Hubs Kafka endpoint, Standard tier and above |
The closest single answers are SNS with SQS on AWS and Service Bus topics on Azure. Both add delayed delivery, which Pub/Sub lacks, and neither adds message priority.
Two Special Cases
If You Need Messages in Browsers or Phones
Some searches for Pub/Sub alternatives come from a different need: pushing live updates to users. Pub/Sub moves messages between services that hold Google Cloud credentials; its client libraries are for server languages, and a topic can have at most 10,000 subscriptions, so it isn't built to hold a channel per user. That job belongs to Firebase Cloud Messaging for app and web notifications, to hosted realtime services such as Ably, PubNub and Pusher, to Azure Web PubSub on Azure, or to WebSocket servers of your own, with Redis Pub/Sub passing each update to every server that holds a connection. Pub/Sub can still feed any of them from the back end.
If You Are Leaving Pub/Sub Lite
Pub/Sub Lite users have no choice about moving: Google turns the service down on January 31, 2027, although its pricing page still shows the earlier date of March 18, 2026. Google documents two destinations, Managed Service for Apache Kafka and Pub/Sub itself. Kafka is the closer fit for code built around Lite's partitions and reserved throughput; Pub/Sub takes capacity planning away but charges more for each byte. In Google's pricing example, 10 MiB/s read by one subscription costs about $608 a month on regional Lite, assuming the 50 percent utilization Google uses, against $2,000 on Pub/Sub. Google Pub/Sub vs Kafka covers both migration paths.
Google Pub/Sub Alternatives Compared
| Option | Model | Where it runs | Operated by | How it charges | Doesn't give you |
|---|---|---|---|---|---|
| Google Pub/Sub (today) | Managed topics and subscriptions | Google Cloud | Per byte, on publish and again for each subscription | Delay, priority, history beyond 31 days, any home outside Google Cloud | |
| Apache Kafka | Partitioned, replicated log | Anywhere; managed by Google on Google Cloud | You, Google or another provider | Capacity: brokers and storage | Per-message acknowledgement on Google's service, push, delay, priority |
| Cloud Tasks | Task queues that call HTTP endpoints | Google Cloud, one region per queue | Per operation, first million free each month | Fan-out, pull consumers, more than 500 dispatches a second per queue | |
| Apache Pulsar | Topics with subscriptions, stored in BookKeeper | Anywhere | You or StreamNative | Servers, or the provider's plan | Message priority, a small footprint |
| NATS JetStream | Streams with durable consumers | Anywhere | You or Synadia | Servers, or the provider's plan | A built-in dead-letter stream, priority |
| RabbitMQ | Exchanges routing to queues; streams | Anywhere; on Google Cloud through GKE or CloudAMQP | You or a provider such as CloudAMQP | Servers, or the provider's plan | Replay outside streams |
| AWS services | SNS topics, SQS queues, EventBridge, Kinesis | AWS | AWS | Per request, event or unit of stream capacity | A home outside AWS, priority |
| Azure services | Service Bus, Event Grid, Event Hubs | Azure | Microsoft | Per operation or reserved capacity | A home outside Azure, priority |
| Redisson PRO on Valkey or Redis | Topics, subscriptions and queues kept in Valkey or Redis | Wherever Valkey or Redis runs, managed or not | You, or a managed Valkey or Redis service | Valkey or Redis nodes, plus a PRO licence | Non-JVM clients, history larger than memory, push to HTTPS, exports |
If Your Services Run on the JVM
For a Java team, leaving Pub/Sub doesn't have to mean adopting a new broker. Most of what a Pub/Sub subscription does is set by flags on one gcloud command, and most of those flags have a counterpart in Reliable PubSub. A typical subscription:
gcloud pubsub subscriptions create orders-billing \
--topic=orders \
--ack-deadline=60 \
--min-retry-delay=10s \
--max-retry-delay=600s \
--dead-letter-topic=orders-billing-dlt \
--max-delivery-attempts=5 \
--message-retention-duration=7d \
--retain-acked-messages \
--message-filter='attributes.type = "OrderPlaced"'
The same subscription in Reliable PubSub, with a publisher and a pull consumer:
import java.time.Duration;
import java.util.ArrayList;
import java.util.List;
import org.redisson.api.Message;
import org.redisson.api.MessageArgs;
import org.redisson.api.RReliablePubSubTopic;
import org.redisson.api.SyncFailureMode;
import org.redisson.api.pubsub.MessageAckArgs;
import org.redisson.api.pubsub.MessageNegativeAckArgs;
import org.redisson.api.pubsub.PublishArgs;
import org.redisson.api.pubsub.PullArgs;
import org.redisson.api.pubsub.PullConsumer;
import org.redisson.api.pubsub.Subscription;
import org.redisson.api.pubsub.SubscriptionConfig;
import org.redisson.api.pubsub.TopicConfig;
RReliablePubSubTopic<OrderEvent> orders =
redisson.getReliablePubSubTopic("orders");
// --message-retention-duration=7d. Retention belongs to the topic here,
// so every subscription shares the same seven days of history.
orders.setConfig(TopicConfig.defaults().timeToLive(Duration.ofDays(7)));
Subscription<OrderEvent> billing = orders.createSubscription(
SubscriptionConfig.name("orders-billing")
// --ack-deadline=60, except that nothing extends it while
// a message is being processed
.visibility(Duration.ofSeconds(60))
.deliveryLimit(5) // --max-delivery-attempts
.deadLetterTopicName("orders-billing-dlt")
.retainAfterAck()); // --retain-acked-messages
// Attributes become headers; priority has no Pub/Sub counterpart.
// THROW_EXCEPTION makes publish() fail if the write isn't confirmed in
// time; by default that only logs a warning.
orders.publish(PublishArgs.messages(MessageArgs.payload(event)
.header("type", "OrderPlaced")
.priority(9))
.syncFailureMode(SyncFailureMode.THROW_EXCEPTION));
PullConsumer<OrderEvent> consumer = billing.createPullConsumer();
while (running) {
// Long poll for up to 50 messages, so an idle loop waits up to
// 10 seconds instead of spinning
List<Message<OrderEvent>> batch = consumer.pullMany(PullArgs.defaults()
.count(50)
.timeout(Duration.ofSeconds(10)));
// --message-filter has no counterpart. Pub/Sub acknowledges the
// messages a filter rejects; here the consumer does it.
List<String> skipped = new ArrayList<>();
for (Message<OrderEvent> message : batch) {
if (!"OrderPlaced".equals(message.getHeaders().get("type"))) {
skipped.add(message.getId());
continue;
}
try {
process(message.getPayload());
consumer.acknowledge(MessageAckArgs.ids(message.getId()));
} catch (RuntimeException e) {
// --min-retry-delay and --max-retry-delay have no counterpart:
// the delay is chosen at each failure
consumer.negativeAcknowledge(MessageNegativeAckArgs
.failed(message.getId())
.delay(Duration.ofSeconds(30)));
}
}
if (!skipped.isEmpty()) {
consumer.acknowledge(
MessageAckArgs.ids(skipped.toArray(new String[0])));
}
}
Four things work differently. A filter becomes a check in the consumer, which acknowledges the messages it skips, as Pub/Sub does for filtered messages. Retry backoff becomes a delay chosen at each failure. The ack deadline becomes a visibility timeout that nothing extends once a message is delivered, so it has to cover your slowest message. And ordering keys become message group IDs, set with MessageArgs.payload(event).groupId(customerId) in Redisson PRO 4.0.0 and later: each group's messages go to a single consumer, though a message that is redelivered can fall out of sequence within its group. There is also no push to an HTTPS endpoint; a push consumer is a listener inside your JVM.
Before moving production traffic, plan for these limits:
- It is a JVM library. Services in other languages stay on Pub/Sub or move to one of the other options.
- History and backlog live in memory. Give each topic a time-to-live, provision memory for the largest backlog a slow consumer could leave, and set the eviction policy to
noevictionin place of Memorystore for Valkey's default,volatile-lru, so that a full instance refuses new writes rather than evicting data. - Valkey and Redis replicate asynchronously. Memorystore for Valkey writes to disk only with RDB snapshots or AOF enabled, AOF syncs once a second by default, and a failover can lose recent writes. Keep Redisson's default
syncMode,AUTO, which waits for the AOF or, without it, for the replicas to confirm each write, and setsyncFailureModetoTHROW_EXCEPTIONas the sample does, because by default an unconfirmed write only logs a warning. On AWS, MemoryDB and ElastiCache for Valkey with synchronous durability log every write before acknowledging it; IBM MQ alternatives covers those settings, and our persistence guide explains the trade-offs. - It is regional. Memorystore for Valkey can keep a secondary instance in another region, but that copy is asynchronous and read-only: a standby for disaster recovery, while publishing stays in the primary region.
- Each topic runs on one primary node. Redisson documents no partitioning for Reliable PubSub and publishes no throughput figures, so measure on your own nodes and spread high rates over several topics.
A PRO licence comes with round-the-clock support under an SLA for the client; Valkey or Redis needs separate support, from your cloud provider or a vendor. A free trial lets you test against your own deployment. The Reliable PubSub documentation lists every setting, and Google Pub/Sub vs Redis for Messaging compares it with Pub/Sub feature by feature, Memorystore costs included. Two related structures cover other Pub/Sub uses: Reliable Queue is a work queue with per-message delay and priority, for jobs you might otherwise give to Cloud Tasks, and Reliable Fanout copies each message into several queues, with a filter per queue that the publisher evaluates, the nearest thing to Pub/Sub's filtered subscriptions.
Moving Off Pub/Sub Gradually
Few teams switch in one release. A sequence that keeps both sides consistent:
- List every subscription with its type (pull, push, BigQuery or Cloud Storage) and note which use filters, ordering, dead-letter topics, retained messages or seek. Push and export subscriptions show where you need connectors or new code.
- Mark the topics that Google services publish to. They stay on Pub/Sub; if their consumers move, a bridge forwards the messages.
- Bridge before cutting over. A small service with a pull subscription can publish each message to the new system and acknowledge it in Pub/Sub only after the new system confirms the write, so a crash in between produces a duplicate rather than a loss. For Kafka, the source connector of Google's Pub/Sub Group Kafka Connector does the same job.
- Make consumers idempotent, because bridges and redeliveries both create duplicates.
- Move publishers one topic at a time, and delete each Pub/Sub subscription once its backlog is empty.
How to Choose
Go down the table and take the first row that describes your situation.
| Situation | Start with |
|---|---|
| You are on Pub/Sub Lite | Managed Service for Apache Kafka if you depend on partitions and reserved capacity, otherwise Pub/Sub; either way, before January 31, 2027 |
| You need to push updates to browsers or mobile apps | Firebase Cloud Messaging or a hosted realtime service, fed from your back end |
| Most of your Pub/Sub traffic is push to Cloud Run, exports to BigQuery or events from Google services | Keep Pub/Sub for that traffic and move only the messaging between your own services, if anything |
| Each job has one HTTP handler and must run at a set time or rate | Cloud Tasks, within 30 days and 500 dispatches a second per queue. For JVM workers on Valkey or Redis: Redisson PRO's Reliable Queue |
| You are moving to AWS | SNS with SQS, plus Kinesis Data Streams for streams. For a system that is all JVM: Redisson PRO, with topics in MemoryDB or in ElastiCache for Valkey with synchronous durability turned on |
| You are moving to Azure | Service Bus topics, plus Event Hubs for streams. If every consumer is on the JVM: Redisson PRO on Azure Managed Redis, once you have checked its persistence settings against your durability needs |
| You need long replayable history, stream processing or the Kafka ecosystem | Kafka: Managed Service for Apache Kafka on Google Cloud, or any Kafka elsewhere. If replay is all you need, every reader runs on the JVM and the history is small enough for memory: Reliable PubSub in Redisson PRO |
| Cost is the trigger: steady, high volume read by several subscriptions | Kafka, priced by capacity rather than by the byte. If the services run on the JVM and consumers rarely fall behind: Reliable PubSub in Redisson PRO, where cost follows the number of nodes |
| You need the same system on several clouds or on premises, with subscriptions and per-message acknowledgements | Pulsar if you can run three tiers; NATS JetStream for a light footprint, with dead letters you build yourself; Redisson PRO if every service is on the JVM and Valkey or Redis already runs |
| Clients in several languages need exchange-based routing, AMQP or MQTT, or per-message delay and priority | RabbitMQ: on Google Cloud, on GKE or from CloudAMQP |
| Your Java services already use Valkey or Redis, need per-message delay or priority, and keep backlogs small enough for memory | Reliable PubSub in Redisson PRO |
Google Pub/Sub Alternatives: Frequently Asked Questions
What Is the Best Alternative to Google Pub/Sub?
It depends on why you are leaving. On Google Cloud, Managed Service for Apache Kafka is Google's own alternative for replayable streams, and Cloud Tasks for jobs that must run later or at a controlled rate. Outside Google Cloud, Apache Pulsar is the open-source system closest to Pub/Sub's model of subscriptions and per-message acknowledgements, NATS JetStream is the lightest to run, and RabbitMQ has the most flexible routing. On AWS the counterpart is SNS with SQS, and on Azure it is Service Bus topics. Java services that already use Valkey or Redis can get the same model from Redisson PRO without adding a broker.
What Is the AWS Equivalent of Google Pub/Sub?
Amazon SNS with Amazon SQS. An SNS topic delivers each message to one SQS queue per consuming service, and each queue gives its consumers per-message acknowledgement through a visibility timeout, plus a redrive policy for dead letters, which together match a Pub/Sub topic and its subscriptions. EventBridge covers events from AWS services, Kinesis Data Streams covers high-volume streams with replay, and Amazon MSK runs Kafka.
What Is the Azure Equivalent of Google Pub/Sub?
Azure Service Bus topics. Each subscription on a topic receives a copy of every message, consumers settle messages under a lock, and messages that keep failing move to a dead-letter subqueue. Event Grid namespace topics, which consumers pull and acknowledge, are also close, but keep events for at most 7 days. Event Hubs is Azure's streaming log, with a Kafka-compatible endpoint.
Is There an Open-Source Alternative to Google Pub/Sub?
Yes, several. Apache Pulsar has the closest model: topics with named subscriptions, shared or key-ordered consumption, negative acknowledgements, dead-letter topics, delayed delivery and replay. NATS JetStream is a single-binary server with durable consumers and acknowledgements, but no built-in dead-letter stream. Apache Kafka and RabbitMQ are the most widely deployed. All four run anywhere, including in a container on a developer's laptop.
Can You Run Google Pub/Sub Locally or On Premises?
Not for production. Pub/Sub runs only on Google Cloud. For development, Google provides an emulator, installed as a gcloud component or run from the Google Cloud CLI Docker image, but it keeps data only while it runs, doesn't support IAM, configurable retention or seeking an ordered subscription to a timestamp, and creates BigQuery subscriptions that never deliver. Teams that need the same system on premises or across clouds choose a broker they can run themselves, such as Pulsar, NATS JetStream, Kafka or RabbitMQ.
Is Google Pub/Sub Free?
Only for small volumes. Each month's first 10 GiB of throughput costs nothing. Beyond that, every TiB costs $40, and a message counts once when it is published and once more for each subscription that reads it, with a 1 KB minimum per request. Storing retained messages, snapshots and unacknowledged messages older than a day costs $0.27 per GiB-month, and BigQuery and Cloud Storage subscriptions are billed at $50 per TiB, with no free allowance.
Is Google Pub/Sub a Message Queue?
Partly. Within one subscription it behaves like a queue: subscribers share the messages, acknowledge each one, and receive unacknowledged messages again. Across subscriptions it is publish/subscribe, because every subscription receives every message. It lacks features many queues have, such as delayed or scheduled delivery and message priority, which is why Google points to Cloud Tasks for work that has to run at a set time.
Is Pub/Sub the Same as WebSocket?
No. WebSocket is a protocol that keeps a two-way connection open between a client, usually a browser, and a server. Publish/subscribe is a messaging pattern, and Google Pub/Sub is a back-end service built on it, for messages between services. To deliver updates to browsers, applications run WebSocket servers or a hosted realtime service, often with a pub/sub system behind them, such as Redis Pub/Sub, to send each update to every server holding a connection.
Similar articles
- Google Pub/Sub vs Kafka: Key Differences, Costs and How to Choose
- Google Pub/Sub vs Redis for Messaging
- Apache Kafka Alternatives: 7 Options Compared
- RabbitMQ Alternatives: Seven Options, and What Each One Breaks
- Apache Pulsar vs. Valkey & Redis based Reliable PubSub
- Amazon Kinesis vs Valkey & Redis Based Reliable PubSub and Queue
- Azure Service Bus vs Valkey & Redis Based Reliable Queue and PubSub
- Azure Service Bus Alternatives: Eight Options and What Each One Lacks
- Amazon SQS vs. Reliable Queue for Valkey and Redis
- All about Reliable PubSub for Valkey and Redis