Files

1 line
2.7 KiB
JSON

{"text":["NATS JetStream","Hanzo PubSub","The bus everything else rides","GitHub","More than pub/sub","01 / 06","Streams write it down","A stream captures the subjects you name and keeps them by age, by count or by bytes. A consumer starts at the beginning, at the newest message, at a sequence number or at a wall-clock time, and reads at the original pace or as fast as it can take them.","Acked, so nothing goes quiet","A message is redelivered until a consumer acknowledges it. Publishers that stamp a message id get duplicates collapsed inside a window — two minutes unless you say otherwise. Ack every message, ack a sequence to cover everything below it, or ask for no acks at all when fire-and-forget is what you meant.","Key-value buckets","A bucket is a stream that keeps the last value per key, so you get watches, per-key history and expiry from the same server and the same connection. It is where Hanzo Stream keeps its consumer offsets.","Request-Reply","Send to a subject and wait for one answer. Put several instances of a service in a queue group on that subject and each request goes to exactly one of them — load balancing with nothing in front of them doing it.","Object Store","Payloads too big to be a message are chunked into a stream and put back together on the way out, with a watch for when one changes. Same connection, same credentials, no second system to stand up.","Accounts, not passwords","An account walls one tenant's subjects off from another's. Credentials are nkeys or signed JWTs rather than a shared secret, permissions are granted per subject, and TLS covers the wire.","Paste and ship","Paste this into any agent. It reads the skill manifest and calls Pubsub from there.","Agent prompt","Copy","Read https://hanzo.ai/skill.md and use Hanzo Pubsub in my project. Start with: hanzo pubsub publish","4222","Client port","Replay","From any point","Durable","Written to disk","Replicas","Set per stream","Publish and Subscribe","events.go","nc","_ := nats","Connect","nats://pubsub.hanzo.ai:4222","js","_ := nc","JetStream","()","// Create a durable stream","AddStream","&nats","StreamConfig","Name","EVENTS","Subjects","[]","string","events.>","},","Storage","nats","FileStorage","})","// Publish","Publish","events.user.signup","byte","{\"id\":\"usr_123\"}","))","// Durable consumer with ack","sub","_ := js","PullSubscribe","my-service","msgs","_ := sub","Fetch","10","for","msg :=","range","process","msg","Data","Ack","Put it between your services","Free tier includes 1M messages/month.","View on GitHub","Get PubSub","Pub/sub messaging","Apache-2.0","License:","hanzoai/pubsub","4 stars","Deploy to Cloud","02 / 06","03 / 06","04 / 06","05 / 06","06 / 06"],"links":["https://github.com/hanzoai/pubsub","https://platform.hanzo.ai/deploy"]}