Danube-Pubsub CLI - Produce messages
The produce command sends messages to a specified topic with support for reliable delivery, custom schemas, and message attributes.
Basic Usage
Required Arguments
-
-s, --service-addr <SERVICE_ADDR>The service URL for the Danube broker (e.g.,http://127.0.0.1:6650) -
-m, --message <MESSAGE>The message content to send -
-f, --file <FILE_PATH>Binary file path to send (takes precedence over --message when specified)
Basic Options
-
-n, --producer-name <PRODUCER_NAME>Producer identifier (default:test_producer) -
-t, --topic <TOPIC>Destination topic (default:/default/test_topic) -
-p, --partitions <NUMBER>Number of topic partitions
Message Configuration
-
-y, --schema <SCHEMA>Message schema type:bytes,string,int64,json(default:string) -
--json-schema <JSON_SCHEMA>Required JSON schema definition when usingjsonschema type -
-a, --attributes <ATTRIBUTES>Message attributes inkey1:value1,key2:value2format -
-c, --count <COUNT>Number of messages to send (default:1) -
-i, --interval <INTERVAL>Delay between messages in milliseconds (default: 500, minimum: 100)
Reliable Delivery Options
-
--reliableEnable reliable message delivery with storage persistence -
-h, --help
Description: Print help information
Example
Basic Message Production
JSON Messages with Schema
danube-cli produce -s http://localhost:6650 -c 100 \
-y json \
--json-schema '{"type": "object", "properties": {"field1": {"type": "string"}}}' \
-m '{"field1":"Hello Danube"}'