Queues
Look at and work with message queues safely: Apache Kafka, and what speaks its protocol (Redpanda, Amazon MSK, Confluent Cloud, Aiven), RabbitMQ, NATS with JetStream, Amazon SQS and Google Cloud Pub/Sub.
The same commands work for all five. Kafka keeps messages in topics; RabbitMQ and SQS keep them in queues; NATS keeps them in streams; Pub/Sub keeps them in subscriptions of a topic. Where this page says "topic", read "queue" for RabbitMQ and SQS and "stream" for NATS. What is different for each is in RabbitMQ, NATS JetStream, Amazon SQS and Google Cloud Pub/Sub below.
In Kafka, messages are kept in order in a topic's partitions, and a consumer group is an application that reads them and remembers how far it got (its committed offset). Lag is how many messages a group still has to read.
Add a Kafka cluster
komando queue add prod-kafka 'kafka://app@b1.example.com:9093,b2.example.com:9093?tls=true&sasl=scram-sha-512' --ask-password
komando test prod-kafka # logs in and shows the Kafka version
Typed alone, komando queue add asks for each part step by step.
The URL lists one or more brokers (HOST:PORT, comma-separated; the port defaults to 9092). One is enough: komando asks it for the others. The user is for the SASL login and its password goes in the vault, never in the URL:
komando secret set kafka-pass
komando queue add prod-kafka 'kafka://app@b1.example.com:9093?tls=true&sasl=scram-sha-512' --password-ref secret:kafka-pass
komando queue add audit-kafka 'kafka://app@kafka.internal:9093?tls=true&ca=secret:kafka-ca&sasl=plain' --ask-password
komando queue add staging-kafka kafka://broker1.internal:9092 --via web1 # no TLS, through an SSH server
| Option | What it does |
|---|---|
tls=true | TLS; the brokers' certificates are checked against your computer's CAs |
ca=secret:NAME | also trust your own CA (a company CA, a cloud's own); store it with komando secret set NAME < ca.pem |
tls=skip-verify | TLS without checking the certificate (komando doctor warns; prefer ca=) |
sasl=plain, sasl=scram-sha-256, sasl=scram-sha-512 | how to log in; needs a user in the URL |
insecure=1 | accept a connection without TLS that crosses the network |
kafka://withouttls=true, straight over the network (no--via, not this computer), would send the login and the messages unencrypted, soqueue addrefuses it withINSECURE_PROTOCOL: addtls=true, or--via, or?insecure=1to accept it (for an AI agent that needs a person's yes).- A user without
sasl=, orsasl=without a user, is refused: komando does not guess how the brokers want you to log in.
At a terminal, a command with the conn or the topic left out asks for it, with a list of your queues. Typed alone, komando queue peek asks which queue, then which topic. An AI agent or a script gets USAGE (exit 2) with an example in the hint.
Through a bastion or a VPN
Kafka clients first ask a broker for the cluster's brokers, then connect to the addresses the brokers advertise. With --via, komando reaches every one of them through the bastion or the VPN, so names that only work inside the network still work. If komando test stops with QUEUE_CONNECT, check that the advertised addresses are reachable from the --via server (komando queue info lists them).
Look at topics and groups
komando queue list prod-kafka # every topic, with partitions, replicas, messages
TOPIC PARTITIONS REPLICAS MESSAGES
orders 6 3 1824410
orders-retry 3 3 212
These commands only read:
komando queue info prod-kafka # brokers (id, address, rack), controller, version
komando queue list prod-kafka 'orders-*' # topics matching a pattern
komando queue list prod-kafka --internal # also __consumer_offsets and friends
komando queue list prod-kafka -n 50 # only the first 50 by name
komando queue describe prod-kafka orders # partitions, offsets, settings, the groups reading it
komando queue groups prod-kafka # consumer groups: state, members, topics, lag
komando queue lag prod-kafka billing # one group, per topic and partition
group: billing (Stable, 2 members), lag 37
TOPIC PARTITION COMMITTED END LAG CLIENT
orders 0 304112 304140 28 billing-1
orders 1 303980 303989 9 billing-2
queue listshows at most 1000 topics (or queues, or streams), the first by name;-nchanges that. A longer list says so ("truncated": true, and a line in the text) so you can narrow it with a pattern.- The message count is the end offset minus the start offset of each partition. On a compacted topic (
cleanup.policy=compact) fewer messages may be left. describeshows only the settings that differ from the brokers' defaults (for exampleretention.ms).
Read messages
komando queue peek prod-kafka orders # the newest 10 messages over all partitions
komando queue peek prod-kafka orders -n 50 --partition 2
komando queue peek prod-kafka orders --oldest -n 5 # the first ones still kept
# partition 2, offset 304139, 2026-11-13T09:14:02Z, key 42
{"id": 42, "status": "paid"}
peek reads straight from the partitions. It never joins a consumer group and never commits an offset, so no application's position moves and no message is removed. It stops once it has the messages that were there when it started; if nothing comes for --idle (5 seconds), it stops and says some may be missing.
- Values that are UTF-8 text are shown as they are; others come as base64 (
"encoding": "base64"). A value longer thanmax_outputis cut (value_truncated, with its realsize). - For AI agents, secrets in messages show as
[hidden], and personal data on protected conns as[hidden: email]and the like.
Send a message
komando queue send prod-kafka orders --value '{"id": 42, "status": "paid"}' --key 42
komando queue send prod-kafka orders --from ./order.json --header source=support
komando queue send prod-kafka orders --value test --dry-run # checks the topic, sends nothing
sent 28 B to orders, partition 2, offset 304140
- The topic must exist (
TOPIC_NOT_FOUND): komando never lets the brokers create one on the fly. Create it withqueue create. --keypicks the partition the usual way: the same key always goes to the same partition.--partition Npicks one itself.- The value comes from
--value, from--from FILE(-for stdin), or from data piped on stdin. Kafka takes about 1 MiB per message by default. - A protected conn asks a person at a terminal first; an AI agent or a script adds
--yesafter a person agrees. - The audit log records the topic and the size, never the message.
Create, delete and empty topics
komando queue create prod-kafka orders --partitions 6 --replicas 3 --dry-run
komando queue create prod-kafka orders --partitions 6 --replicas 3 --config retention.ms=604800000
komando queue purge prod-kafka orders-retry --dry-run # how many messages would go
komando queue purge prod-kafka orders-retry # delete every message, keep the topic
komando queue rm prod-kafka old-orders --dry-run
komando queue rm prod-kafka old-orders # delete the topic and its messages
would delete 212 messages from orders-retry (3 partitions); the topic stays
create --dry-runasks the brokers to check the topic without making it, so a bad setting or more replicas than brokers shows now.- Without
--partitionsand--replicasthe brokers' defaults apply. purgeandrmcannot be undone (rulesqueue-purgeandqueue-deleteinkomando policy list). Their--dry-runlists what would go. At your terminal komando asks you first: it says what would be deleted and asks for the topic's or queue's name (the count, when several go).$ komando queue purge prod-kafka orders-retry This deletes every message in orders-retry (it stays). Type the name orders-retry to continue: orders-retryAnything else stops it and changes nothing. An AI agent or a script gets
POLICY_BLOCKED(exit 6) with the same reason, and adds--allow-dangerousonly after a person agrees. See Safety.
RabbitMQ
Add a RabbitMQ server
komando secret set rabbit-pass
komando queue add prod-rabbit 'amqps://app@rabbit.example.com:5671/%2F?management=15671' --password-ref secret:rabbit-pass
komando queue add staging-rabbit 'amqp://app@rabbit.internal:5672/prod?management=15672' --via web1 --password-ref secret:rabbit-pass
komando queue info prod-rabbit # version, cluster, nodes, totals
komando queue list prod-rabbit # queues: messages, ready, unacked, consumers
komando queue peek prod-rabbit emails # the first 10 messages; all of them go back
amqps://is AMQP with TLS (port 5671 by default);amqp://has no TLS (port 5672). Likeredis://,amqp://straight over the network (no--via, not this computer) is refused withINSECURE_PROTOCOLunless you add?insecure=1.- The path is the virtual host (vhost). The default vhost is
/, written%2For left out (amqp://app@rabbit.internal/). - The user's password goes in the vault (
--password-ref), never in the URL. A URL without a user logs in asguest(passwordguest, or the one--password-refgives). RabbitMQ letsguestin only from the server itself, so that works--viathe server's SSH.
| Option | What it does |
|---|---|
management=PORT | also use the management HTTP API on this port of the same host (HTTPS for amqps://), for queue list, the nodes and the totals in info, and the details in describe |
ca=secret:NAME | amqps://: also trust your own CA (komando secret set NAME < ca.pem) |
tls=skip-verify | amqps:// without checking the certificate (komando doctor warns; prefer ca=) |
insecure=1 | accept amqp:// across the network without TLS |
The management API is the rabbitmq_management plugin. It takes users with the management, monitoring or administrator tag; komando only reads from it. Without ?management=, komando uses AMQP alone: info shows the server's version and describe shows how many messages wait and how many consumers a queue has, but queue list cannot list queues (NOT_SUPPORTED).
What each command does on RabbitMQ
komando queue describe prod-rabbit emails # type, state, messages, arguments, consumers
komando queue peek prod-rabbit emails -n 5 # the first 5 messages; nothing is removed
komando queue send prod-rabbit emails --value '{"to": "a@example.com"}' --header source=support
komando queue create prod-rabbit emails --type quorum --config x-max-length=10000 --dry-run
komando queue purge prod-rabbit emails --dry-run # how many messages wait
komando queue rm prod-rabbit emails
peektakes messages from the front of the queue and gives every one back. It reads withbasic.getand does not acknowledge, then returns them all (nackwith requeue), so nothing is removed. Good to know:- RabbitMQ marks the messages it gets back as redelivered. A consumer that treats redelivered messages differently will see that flag.
- For the moment peek holds them, no consumer gets them, and a busy queue may hand them out in a slightly different order afterwards.
- If the connection breaks, RabbitMQ puts the messages back by itself.
- A quorum queue counts each peek as one delivery (
x-delivery-count). After its delivery limit (20 by default since RabbitMQ 4.0, or the queue's ownx-delivery-limitor policy) it drops a message or sends it to its dead-letter queue. So peek shows the count (deliveries) and stops withDELIVERY_LIMIT_NEARonce a message has fewer than 3 deliveries left: do not peek that queue again. It takes no message after that one, so the messages behind it are not counted down too. Only the management API tells a queue's type and its own limit, so peek needs?management=in the conn's URL: without it (or when the management API fails) peek stops before it takes a message (NOT_SUPPORTED, or the management API's error). - A stream queue cannot be peeked this way (
NOT_SUPPORTED). - peek always reads from the front (
"from": "front"), which is already the oldest;--partitionand--idleare for Kafka.
sendputs the message straight into the queue (through the default exchange), as a persistent message, and waits until the server confirms it.--header KEY=VALUEsets its headers; there is no--keyor--partition.createmakes a durable queue.--typepicksclassic,quorumorstream(left out: the vhost's default).--config KEY=VALUEsets the queue's arguments, such asx-max-length=10000orx-overflow=reject-publish. RabbitMQ cannot check a queue without making it, socreate --dry-runonly checks that the name is free. A queue that is there already isQUEUE_EXISTS.purgedeletes the messages that wait (ready). Messages a consumer holds and has not acknowledged yet stay.rmdeletes the queue and its messages, and cancels its consumers;--dry-runshows how many of each. Both cannot be undone, so they ask first, as for Kafka.groupsandlaganswerNOT_SUPPORTED: RabbitMQ has no consumer groups.describeshows a queue's consumers, the messages waiting for them (ready) and those not acknowledged yet (unacked).
NATS JetStream
Add a NATS server
komando secret set nats-pass
komando queue add prod-nats 'tls://app@nats1.example.com:4222,nats2.example.com:4222' --password-ref secret:nats-pass
komando queue add staging-nats nats://nats.internal:4222 --via web1 --password-ref secret:nats-pass
komando secret set ngs-creds < user.creds
komando queue add ngs-nats 'tls://connect.ngs.global?creds=secret:ngs-creds'
komando queue info prod-nats # version, server, the account's streams and limits
komando queue list prod-nats # streams: subjects, messages, size, consumers
komando queue peek prod-nats ORDERS # the newest 10 messages; none is taken away
tls://is NATS with TLS;nats://has no TLS. The port is 4222 by default. Likeredis://,nats://straight over the network (no--via, not this computer) is refused withINSECURE_PROTOCOLunless you add?insecure=1.- List several servers of a cluster with commas. komando tries them in that order and talks only to the servers in the URL (with
--via, all of them are reached through the bastion or the VPN). It tries each server once and does not reconnect or follow the servers the cluster advertises. - How komando logs in:
- a user in the URL and
--password-ref: user and password; --password-refwithout a user: the password is sent as a token;?creds=secret:NAME: a.credsfile (fromnsc, NGS or Synadia Cloud) that you keep in the vault withkomando secret set NAME < user.creds;- none of these: no login.
- a user in the URL and
komando test prod-natslogs in and shows the server's version.
| Option | What it does |
|---|---|
creds=secret:NAME | log in with the .creds file kept in the vault |
domain=NAME | the JetStream domain, for a leaf node with its own JetStream |
ca=secret:NAME | tls://: also trust your own CA (komando secret set NAME < ca.pem) |
tls=skip-verify | tls:// without checking the certificate (komando doctor warns; prefer ca=) |
insecure=1 | accept nats:// across the network without TLS |
Streams, subjects and consumers
Plain NATS forgets a message once it is delivered. JetStream keeps messages in streams: a stream keeps every message sent to its subjects (for example orders.>, every subject that starts with orders.), numbered with a sequence. A consumer is an application's place in a stream: what it has been given and what it has acknowledged.
komando queue describe prod-nats ORDERS # settings, limits, sequences, cluster, consumers
komando queue groups prod-nats # every consumer: pending, ack pending, waiting
komando queue lag prod-nats ORDERS/billing # one consumer (the name alone works when only one stream has it)
komando queue peek prod-nats ORDERS -n 5 # the newest 5 messages
komando queue peek prod-nats ORDERS --oldest # the first ones still kept
komando queue send prod-nats orders.new --value '{"id": 42}' --header source=support
komando queue create prod-nats ORDERS --config subjects='orders.>' --config max_age=7d --dry-run
komando queue purge prod-nats ORDERS --dry-run # how many messages would go
komando queue rm prod-nats ORDERS
peekreads messages by their sequence number. It makes no consumer and acknowledges nothing, so no application notices and nothing is removed, also from a work-queue stream (where an acknowledgement deletes the message). By default it shows the newest-nmessages;--oldestshows the first ones. Deleted messages in between are skipped. In a stream with more than 100000 deleted messages the newest may come out incomplete, and peek says so;--oldestalways works.sendtakes a subject, not a stream name:orders.new, notORDERS. komando first checks which stream keeps that subject; when none does, it stops withSTREAM_NOT_FOUND(plain NATS would drop the message without a word). It then waits for the stream's acknowledgement and says the message's sequence. ANats-Msg-Idheader (--header Nats-Msg-Id=order-42) lets the stream drop duplicates. There is no--keyor--partition.createmakes a stream on disk (storage=file) that keeps messages until a limit (retention=limits). Its subjects are the stream's name unless you give--config subjects=a.>,b.*. Other settings:storage=memory,retention=interest|workqueue,discard=old|new,max_msgs,max_bytes,max_age(24h,7d),max_msg_size,max_msgs_per_subject,max_consumers,duplicate_window,description.--replicas 3keeps 3 copies on a cluster. JetStream cannot check a stream without making it, socreate --dry-runchecks the name and the settings only. A stream that is there already isSTREAM_EXISTS.purgedeletes every message of a stream; the stream and its consumers stay.rmdeletes the stream, its messages and its consumers. Both cannot be undone, so they ask first, as for Kafka.groupslists consumers. Pending is what a consumer has not been given yet (shown as its lag); ack pending is what it was given and has not acknowledged yet.stateisactive(a push consumer with a subscriber, or a pull consumer with requests waiting),idleorpaused.- Key-value buckets (
KV_NAME) and object stores (OBJ_NAME) are streams too, andqueue listlists them. - A server or account without JetStream:
infosaysjetstream: false, and the other commands answerNOT_SUPPORTED.
Amazon SQS
Add an SQS region
An SQS conn is one AWS region of one account. You give the queue's name to each command, not in the URL. komando logs in with your AWS login, the same way as for S3 buckets and ECR registries, and needs no aws CLI:
komando queue add prod-sqs sqs://eu-west-1 --option aws_profile=prod # a profile in ~/.aws (SSO, a role, keys)
komando login aws --profile prod # a person renews an SSO login when it runs out
komando queue add staging-sqs sqs://eu-west-1 # no profile: AWS_* variables, ~/.aws default, or the server's role
komando secret set sqs-secret # or: keys of an IAM user
komando queue add ops-sqs sqs://AKIAIOSFODNN7EXAMPLE@eu-west-1 --password-ref secret:sqs-secret
komando queue info prod-sqs # region, account, how many queues
komando queue list prod-sqs # queues: waiting, in flight, delayed, dead-letter queue
komando queue peek prod-sqs orders # up to 10 messages; none is hidden or deleted
- How komando logs in, in this order: the conn's
aws_profileoption (from~/.aws/configand~/.aws/credentials, SSO included); the access key ID in the URL with the secret key from--password-ref; or, with neither, the usual AWS chain (theAWS_ACCESS_KEY_IDandAWS_PROFILEvariables, the default profile, an EC2 or ECS role). - An expired SSO login stops with
AWS_LOGIN_REQUIRED: a person runskomando login aws --profile NAMEonce. komando test prod-sqslogs in and lists one queue.
| Option | What it does |
|---|---|
endpoint=URL | another SQS server: a VPC endpoint, or an emulator such as LocalStack or moto (http://localhost:4566; at localhost with no key or profile, komando logs in with the key test) |
account=ID | the 12-digit AWS account that owns the queues, to use queues another account shared with you |
insecure=1 | accept an http:// endpoint across the network (no --via, not this computer) |
An http:// endpoint straight over the network is refused with INSECURE_PROTOCOL unless you add ?insecure=1: the messages and a temporary login's session token would travel unencrypted.
What each command does on SQS
komando queue describe prod-sqs orders # counts, settings, dead-letter queue, tags
komando queue send prod-sqs orders --value '{"id": 42}' --header source=support
komando queue send prod-sqs orders.fifo --key customer-7 --value '{"id": 42}'
komando queue create prod-sqs orders.fifo --config ContentBasedDeduplication=true --dry-run
komando queue create prod-sqs jobs --config VisibilityTimeout=120 --config MessageRetentionPeriod=86400
komando queue purge prod-sqs orders --dry-run # about how many messages would go
komando queue rm prod-sqs old-jobs
peekreceives messages with a visibility timeout of 0 and never deletes them. Normally a received message is hidden from other consumers for a while and then deleted by the consumer that got it. With a visibility timeout of 0 nothing is hidden, and komando never deletes, so every message stays and consumers can receive it at once.- SQS hands out messages in no set order (a FIFO queue: in order within a message group), so
peekshows a sample of what waits, not the newest. There is no--oldestor--partition. - Every receive counts. SQS raises each message's receive count, also for a peek. A queue with a dead-letter queue moves a message there after
maxReceiveCountreceives (itsRedrivePolicy). So peek refuses a queue whose limit is 3 or less, and stops withDELIVERY_LIMIT_NEARonce a message it showed has fewer than 3 receives left. Peek the dead-letter queue instead, or let the consumers take the message. - The counts SQS gives are approximate. Messages are waiting to be received; in flight were received and not yet deleted; delayed were sent with a delay that has not passed yet.
sendtakes text only;--headervalues become message attributes. A FIFO queue (its name ends in.fifo) needs--key, the message group: messages of one group are received in order. komando gives each FIFO message a new deduplication ID, unless the queue deduplicates by content.createmakes a standard queue, or a FIFO queue when the name ends in.fifo.--configtakes SQS's own setting names (VisibilityTimeout,MessageRetentionPeriod,DelaySeconds,MaximumMessageSize,ReceiveMessageWaitTimeSeconds,RedrivePolicy,KmsMasterKeyId,ContentBasedDeduplication, ...). SQS cannot check a queue without making it, socreate --dry-runchecks the name and the setting names only. A queue that is there already isQUEUE_EXISTS.purgedeletes every message, also those in flight, and keeps the queue; SQS allows one purge per queue every 60 seconds.rmdeletes the queue; SQS needs 60 seconds before a queue of the same name can be made again. Both cannot be undone, so they ask first, as for Kafka.groupsandlaganswerNOT_SUPPORTED: SQS has no consumer groups.describeshows how many messages are in flight.
Google Cloud Pub/Sub
Add a Pub/Sub project
A Pub/Sub conn is one Google Cloud project. You give the topic's or the subscription's name to each command, not in the URL. komando logs in the same way as for gs:// buckets and needs no gcloud or Google SDK:
komando queue add prod-pubsub pubsub://my-project # gcloud's login (application default credentials)
komando secret set pubsub-key < key.json # or: a service account key
komando queue add staging-pubsub pubsub://my-project --password-ref secret:pubsub-key
komando queue add local-pubsub 'pubsub://test-project?endpoint=http://localhost:8085' # the emulator: no login
komando queue info prod-pubsub # how many topics and subscriptions
komando queue list prod-pubsub # topics and how many subscriptions each has
komando queue groups prod-pubsub # subscriptions: topic, delivery, ack deadline
komando queue peek prod-pubsub billing # up to 10 messages of subscription billing; all given back
- How komando logs in: the service account key in
--password-ref, or else, on Google's own endpoint (*.googleapis.com), your application default credentials (theGOOGLE_APPLICATION_CREDENTIALSfile, the onegcloud auth application-default loginmakes, or the server's own account on Google Cloud). Give the login the role it needs:roles/pubsub.viewerto look,roles/pubsub.subscriberto peek,roles/pubsub.publisherto send,roles/pubsub.editorto create and delete. - An
endpoint=that is not Google's never gets your gcloud login: that token is good for your whole Google Cloud account. Give such an endpoint its own key with--password-ref, or none. - A login only ever travels over HTTPS. The emulator (
http://) takes none, so komando sends none there: a key in--password-refon anhttp://endpoint is refused (USAGE). komando test prod-pubsublogs in and lists one topic.
| Option | What it does |
|---|---|
endpoint=URL | another Pub/Sub server: a regional endpoint (https://europe-west1-pubsub.googleapis.com), a private one, or the emulator (http://localhost:8085) |
insecure=1 | accept an http:// endpoint across the network (no --via, not this computer) |
An http:// endpoint straight over the network is refused with INSECURE_PROTOCOL unless you add ?insecure=1: the messages would travel unencrypted.
Topics and subscriptions
In Pub/Sub you send to a topic, and the topic hands each message to every one of its subscriptions. Messages wait in a subscription until a program that pulls from it acknowledges them. So a subscription is where the messages are, and also what other systems call a consumer group.
A name you give is a topic or a subscription:
peekandpurgetake a subscription (billing).describe,send,createandrmtake a topic (orders);describealso finds a subscription when there is no topic of that name.- Write
subscriptions/NAME(ortopics/NAME) to say which, for example to delete a subscription: topics and subscriptions often share a name.
Pub/Sub does not count waiting messages (Cloud Monitoring does), so messages is -1 in the JSON and the text says "does not count". lag answers NOT_SUPPORTED.
What each command does on Pub/Sub
komando queue describe prod-pubsub orders # a topic and its subscriptions
komando queue describe prod-pubsub subscriptions/billing
komando queue send prod-pubsub orders --value '{"id": 42}' --header source=support --key customer-7
komando queue create prod-pubsub orders --config messageRetentionDuration=7d --dry-run
komando queue create prod-pubsub subscriptions/billing --config topic=orders --config ackDeadlineSeconds=60
komando queue purge prod-pubsub billing --dry-run # empties subscription billing
komando queue rm prod-pubsub subscriptions/billing old-orders --dry-run
peekpulls messages and gives every one back unacknowledged. It never acknowledges, so nothing is removed: when it is done it sets each message's ack deadline to 0 and Pub/Sub delivers it again at once. For the second or two peek runs, the messages it holds are not handed to other programs; if komando is stopped halfway, Pub/Sub hands them out again after the subscription's ack deadline. Pub/Sub gives no set order, so there is no--oldestor--partition.- With a dead-letter topic every delivery counts. After
maxDeliveryAttemptsdeliveries Pub/Sub moves a message to the dead-letter topic, and a peek is a delivery. So peek stops withDELIVERY_LIMIT_NEARonce a message it showed has fewer than 3 left. A subscription whose limit is 3 or less is refused before peek pulls anything. Let the subscribers take the message, or peek a subscription of the dead-letter topic. - Push, BigQuery and Cloud Storage subscriptions are delivered by Pub/Sub itself: peek a pull subscription of the same topic instead.
sendpublishes to a topic.--headervalues become attributes and--keyis the ordering key (a subscription with ordering gets the messages of one key in order).create NAMEmakes a topic;create subscriptions/NAME --config topic=TOPICmakes a subscription.--configtakes Pub/Sub's own setting names:messageRetentionDuration(7d,36h),kmsKeyName; for subscriptions alsoackDeadlineSeconds,retainAckedMessages,enableMessageOrdering,enableExactlyOnceDelivery,filter,deadLetterTopic,maxDeliveryAttemptsandpushEndpoint;labels.KEY=VALUEon both. Pub/Sub cannot check a topic without making it, socreate --dry-runchecks the names and settings only.purgeempties a subscription and keeps it: every message published until now counts as acknowledged (a "seek" to now), also those a program pulled and has not acknowledged. The topic's other subscriptions keep theirs.rmdeletes topics, or subscriptions writtensubscriptions/NAME. Deleting a topic does not delete its subscriptions: they keep their messages, cut off from the topic. Deleting a subscription deletes the messages waiting in it.purgeandrmcannot be undone, so they ask first, as for Kafka.
Check, change, rename or remove a queue conn
A queue is a conn, so the conn commands work on it:
komando test prod-kafka # can komando reach it and log in?
komando conn show prod-kafka # its URL, way in and password reference
komando conn edit prod-kafka --protected # every change then needs a person's yes
komando conn rename prod-kafka orders-kafka
komando conn rm prod-kafka # komando forgets it; the topics stay
Limits
- RabbitMQ: a vhost whose name holds
/is written URL-encoded (%2F); a path with a second/is refused. - RabbitMQ and NATS:
ca=andtls=skip-verifycannot be used together. - NATS: a user in the URL and
creds=together are refused: pick one. - SQS: komando does not read
AWS_ENDPOINT_URLorAWS_ENDPOINT_URL_SQS: the conn's URL says where it goes. Use?endpoint=for another server. - Pub/Sub: the URL has no user. Google logins have none, and a user is refused. Topics of another project need a conn of their own.
- Pub/Sub: an empty message with no
--headeris refused. - Pub/Sub:
pushEndpointmust be anhttps://address. - komando has no command to rename, copy or back up a topic.
Troubleshooting
| Error | What it means and what to do |
|---|---|
QUEUE_CONNECT | the brokers cannot be reached, or want TLS (?tls=true) or a login (?sasl=); with --via, the advertised addresses must be reachable from there |
QUEUE_AUTH | check the user, the sasl= mechanism and the password (komando conn show NAME); SQS: the AWS profile or keys; Pub/Sub: the service account key, or gcloud auth application-default login |
AWS_LOGIN_REQUIRED, AWS_PROFILE_NOT_FOUND | SQS: a person runs komando login aws --profile NAME, or fix the conn's aws_profile option |
QUEUE_DENIED | the user lacks a Kafka ACL for the topic, group or cluster, a RabbitMQ permission on the vhost or queue, a NATS permission on the subject or the JetStream API, an IAM permission for SQS (sqs:ReceiveMessage, ...), or a Pub/Sub role (roles/pubsub.subscriber, ...; or the Pub/Sub API is not enabled): ask the admin |
TOPIC_NOT_FOUND, CONSUMER_GROUP_NOT_FOUND, PARTITION_NOT_FOUND | check the name with queue list, queue groups or queue describe |
TOPIC_EXISTS | queue create of a topic that is there |
QUEUE_NOT_FOUND, QUEUE_EXISTS | RabbitMQ: no such queue in the conn's vhost, or one is there already; check the vhost in the URL's path. SQS: check the region (the URL's host) and, for another account's queue, ?account= |
SUBSCRIPTION_NOT_FOUND, SUBSCRIPTION_EXISTS | Pub/Sub: no such subscription (queue groups lists them; peek takes a subscription, not a topic), or one is there already |
DELIVERY_LIMIT_NEAR | a message of a RabbitMQ quorum queue is close to its delivery limit, an SQS message close to its queue's maxReceiveCount, or a Pub/Sub message close to its subscription's maxDeliveryAttempts: stop peeking and let its consumers take the message |
STREAM_NOT_FOUND, STREAM_EXISTS, CONSUMER_NOT_FOUND | NATS: no such stream (for send: no stream keeps that subject), one is there already, or no such consumer; queue list and queue groups show the names |
NOT_SUPPORTED | the engine cannot do this (RabbitMQ: groups, lag, queue list and peek without ?management=, peek of a stream queue; NATS without JetStream; SQS: groups, lag, peek --oldest; Pub/Sub: lag, peek --oldest, peek of a push subscription; peek --idle on anything but Kafka; flags a kind does not have: --partition, --key, --type, --internal, --partitions, --replicas); the hint says what works instead |
Source: docs/features/queues.md in sgnd/komando at commit b622784.