Go examples: add a multi-tenant producer and consumer

Aperta
#4,695 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@chaitanya-y20 ci sta già lavorando.

Dal 2/11/2026.

  • #4716 di @chaitanya-y20 — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
66/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
go

Direzione di ricerca

Start with the Rust model in examples/rust/src/multi-tenant/ to see how each tenant gets a stream, topic and restricted user, and how the cross-tenant access check works. Then read CreateUser and UpdatePermissions in foreign/go/client/tcp/tcp_user_management.go and the Permissions type in foreign/go/contracts. Done means examples/go/multi-tenant/producer/main.go and consumer/main.go run against a fresh server, the README section is added, and a second run fails cleanly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

go good first issue
Description

The Rust, Java and Node examples include a multi-tenant example: each tenant gets its own stream and its own user, limited to that stream, and the example shows that a tenant cannot reach another tenant's stream. The Go examples have none.

Affected area / component

Go examples

Proposed solution

Add examples/go/multi-tenant/producer/main.go and examples/go/multi-tenant/consumer/main.go, and a README section in examples/go/README.md.

  • Use examples/rust/src/multi-tenant/ as the model. It takes the tenant count from the TENANTS_COUNT environment variable (default 3) and checks that access to other tenants' streams is refused.
  • The Go client already has CreateUser and UpdatePermissions (foreign/go/client/tcp/tcp_user_management.go) and the Permissions type in foreign/go/contracts.
  • The producer creates each tenant's stream, topic and restricted user, sends messages as each tenant, and prints that reading another tenant's stream is rejected.
  • The consumer reads one tenant's messages as that tenant.
  • Running it twice against the same server should fail with a clear message or clean up, not panic.

Consumer groups and TLS are out of scope.

How to test: start a fresh server (cargo run --bin iggy-server -- --fresh --with-default-root-credentials) and run the producer and consumer from examples/go with the commands added to the README.

Good first issue
  • I think this could be a good first issue for a new contributor
Lingua principale
Rust
Stelle
5.2k
Fork
502
Merge medio
3g 4h
PR unite (30g)
157

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/iggy

Tutte le issue di apache/iggy

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.