{"id":47946868,"url":"https://github.com/zannis/shove","last_synced_at":"2026-05-23T22:04:13.791Z","repository":{"id":348015967,"uuid":"1196095347","full_name":"zannis/shove","owner":"zannis","description":"Type-safe, high performance pub/sub for Rust","archived":false,"fork":false,"pushed_at":"2026-04-05T22:38:05.000Z","size":681,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-06T10:10:48.141Z","etag":null,"topics":["pubsub","rabbitmq","rabbitmq-consumer","rabbitmq-producer","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zannis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-30T11:16:40.000Z","updated_at":"2026-04-05T22:24:33.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zannis/shove","commit_stats":null,"previous_names":["zannis/shove"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/zannis/shove","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zannis%2Fshove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zannis%2Fshove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zannis%2Fshove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zannis%2Fshove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zannis","download_url":"https://codeload.github.com/zannis/shove/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zannis%2Fshove/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31564915,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"ssl_error","status_checked_at":"2026-04-08T14:31:17.202Z","response_time":54,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["pubsub","rabbitmq","rabbitmq-consumer","rabbitmq-producer","rust"],"created_at":"2026-04-04T08:49:40.761Z","updated_at":"2026-05-17T04:03:57.619Z","avatar_url":"https://github.com/zannis.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# shove\n\n[![ci](https://github.com/zannis/shove/actions/workflows/ci.yml/badge.svg)](https://github.com/zannis/shove/actions/workflows/ci.yml)\n[![Latest Version](https://img.shields.io/crates/v/shove.svg)](https://crates.io/crates/shove)\n[![Docs](https://docs.rs/shove/badge.svg)](https://docs.rs/shove)\n[![License:MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Coverage](https://codecov.io/gh/zannis/shove/branch/main/graph/badge.svg)](https://codecov.io/gh/zannis/shove)\n\nType-safe async pub/sub for Rust. One API across RabbitMQ, AWS SNS+SQS, NATS JetStream, Apache Kafka, Redis/Valkey Streams, and an in-process backend.\n\n**Guides, examples, and the full walkthrough live at [shove.rs](https://shove.rs).** Rustdoc on [docs.rs/shove](https://docs.rs/shove).\n\n## Why shove\n\n- **Typed topics** — define a topic once as a Rust type; queue names, DLQs, and hold queues all derive from it.\n- **Retry topologies without glue code** — escalating backoff through hold queues, DLQ routing, retry budgets, handler timeouts.\n- **Strict per-key ordering** — `SequencedTopic` with pluggable failure policies (`Skip` or `FailAll`), enforced by the broker.\n- **Consumer groups + autoscaling** — min/max bounds driven by queue depth (or consumer lag on Kafka), with optional structured audit trails.\n- **One API across six backends** — swap the transport without changing topic definitions or handlers.\n\nIf you have one queue, one consumer, and little retry logic, use `lapin`, the AWS SDK, `async-nats`, or `rdkafka` directly. `shove` is the layer for multi-service event flows that need operational discipline.\n\n## 30-second tour\n\nNo Docker, no credentials, no config — this runs against the in-process backend:\n\n```rust,no_run\nuse serde::{Deserialize, Serialize};\nuse shove::inmemory::{InMemoryConfig, InMemoryConsumerGroupConfig};\nuse shove::{\n    Broker, ConsumerGroupConfig, InMemory, MessageHandler, MessageMetadata, Outcome,\n    TopologyBuilder, define_topic,\n};\nuse std::time::Duration;\n\n#[derive(Debug, Clone, Serialize, Deserialize)]\nstruct OrderPaid { order_id: String }\n\ndefine_topic!(Orders, OrderPaid,\n    TopologyBuilder::new(\"orders\")\n        .hold_queue(Duration::from_secs(5))  // retry with backoff\n        .dlq()                               // dead-letter on permanent failure\n        .build());\n\nstruct Handler;\nimpl MessageHandler\u003cOrders\u003e for Handler {\n    type Context = ();\n    async fn handle(\u0026self, msg: OrderPaid, _: MessageMetadata, _: \u0026()) -\u003e Outcome {\n        println!(\"paid: {}\", msg.order_id);\n        Outcome::Ack\n    }\n}\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c(), shove::ShoveError\u003e {\n    use futures::FutureExt as _;\n\n    let broker = Broker::\u003cInMemory\u003e::new(InMemoryConfig::default()).await?;\n    broker.topology().declare::\u003cOrders\u003e().await?;\n\n    let publisher = broker.publisher().await?;\n    publisher.publish::\u003cOrders\u003e(\u0026OrderPaid { order_id: \"ORD-1\".into() }).await?;\n\n    let mut group = broker.consumer_group();\n    group\n        .register::\u003cOrders, _\u003e(\n            ConsumerGroupConfig::new(InMemoryConsumerGroupConfig::new(1..=1)),\n            || Handler,\n        )\n        .await?;\n\n    let outcome = group\n        .run_until_timeout(tokio::signal::ctrl_c().map(drop), Duration::from_secs(5))\n        .await;\n    std::process::exit(outcome.exit_code());\n}\n```\n\nSwap `InMemory` for `RabbitMq`, `Sqs`, `Nats`, `Kafka`, or `Redis` — the topic and handler stay identical. Per-backend setup: [Getting Started](https://shove.rs/getting-started).\n\n## Backends\n\n| Backend              | Feature flag    | Marker     | Ordering primitive                    | Autoscale signal       |\n|----------------------|-----------------|------------|---------------------------------------|------------------------|\n| RabbitMQ             | `rabbitmq`      | `RabbitMq` | Consistent-hash exchange + SAC shards | Queue depth            |\n| AWS SNS+SQS          | `aws-sns-sqs`   | `Sqs`      | FIFO topic + `MessageGroupId`         | Queue depth            |\n| NATS JetStream       | `nats`          | `Nats`     | Subject shard + `max_ack_pending=1`   | Pending messages       |\n| Apache Kafka         | `kafka`         | `Kafka`    | Partition key                         | Consumer lag           |\n| Redis/Valkey Streams | `redis-streams` | `Redis`    | FNV-1a shard streams                  | XLEN + XPENDING        |\n| In-process           | `inmemory`      | `InMemory` | Per-key FIFO shards                   | Queue depth (in-proc)  |\n\n\u003e **Redis/Valkey requirement:** Redis 6.2+ (or an equivalent Valkey release) is required. shove uses `ZRANGE … BYSCORE` for hold-queue polling, which was introduced in Redis 6.2. The version is validated at connection time and an error is returned if the server is older.\n\n`cargo add shove --features \u003cflag\u003e`. No features are enabled by default. Decision guide: [Choosing a backend](https://shove.rs/backends/choosing).\n\nOptional add-ons: `audit` (built-in `ShoveAuditHandler` + `AuditLog` topic), `metrics` (Prometheus/StatsD/OTel via the [`metrics`](https://docs.rs/metrics) facade), `kafka-ssl` (TLS + SASL), `rabbitmq-transactional` (exactly-once routing).\n\n## Delivery\n\n`shove` is at-least-once by default — handlers must be idempotent. A handler returns one of:\n\n- `Ack` — success\n- `Retry` — delayed retry through hold queues with escalating backoff\n- `Reject` — dead-letter immediately\n- `Defer` — delay without consuming a retry budget\n\nHandler timeouts convert to `Retry`. Full semantics: [Outcomes \u0026 Delivery](https://shove.rs/concepts/outcomes).\n\n## Performance\n\nMacBook Pro M4 Max, single RabbitMQ node via Docker, Rust 1.91. Reproducible via `cargo run -q --example rabbitmq_stress --features rabbitmq`.\n\n| Handler          | 1 worker, prefetch=1 | 1 worker, prefetch=20 | 8 workers, prefetch=20 | 32 workers, prefetch=40 |\n|------------------|----------------------|-----------------------|------------------------|-------------------------|\n| Fast (1–5 ms)    | 179 msg/s            | 2,866 msg/s           | 19,669 msg/s           | 29,207 msg/s            |\n| Slow (50–300 ms) | 6 msg/s              | 75 msg/s              | 544 msg/s              | 4,076 msg/s             |\n| Heavy (1–5 s)    | 0.4 msg/s            | 5 msg/s               | 21 msg/s               | 199 msg/s               |\n\n`prefetch_count` is the primary throughput lever for I/O-bound handlers. Tuning notes: [Performance](https://shove.rs/ops/performance).\n\n## Learn more\n\n- [Getting Started](https://shove.rs/getting-started) — install, declare your first topic, publish and consume on every backend\n- [Core concepts](https://shove.rs/concepts/topics) — topics \u0026 topology, outcomes, handlers \u0026 context, the `Broker\u003cB\u003e` pattern\n- [Guides](https://shove.rs/guides/retries) — retries, sequenced delivery, consumer groups, audit, observability, exactly-once, shutdown\n- [Backends](https://shove.rs/backends/choosing) — per-backend overviews and runnable examples\n- [docs.rs/shove](https://docs.rs/shove) — full rustdoc\n\n## Requirements\n\n- Rust 1.85 or newer (edition 2024).\n- Redis 6.2+ or Valkey (any release) when using the `redis-streams` backend.\n\n## License\n\n[MIT](LICENSE)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzannis%2Fshove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzannis%2Fshove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzannis%2Fshove/lists"}