Skip to main content

Protocol options

In a protocol-direct run, -opt key=value sets an option for the protocol. Repeat the flag for more than one:

vegaload run -target kafka://localhost:9092 -protocol kafka \
-opt mode=produce -opt topic=orders -opt acks=all

In a scenario, the same keys go in the options object of the call, as in mqtt.publish(url, { topic: "sensors/1", qos: 1 }). See Scenarios.

This page lists the keys. The guide for each protocol says what they mean and shows runs you can copy. The lists come from vegaload protocols, so they match the binary. Run vegaload protocols NAME for one protocol.

TLS keys​

Protocols with TLS accept four more keys: ca_file, cert_file, key_file and tls_server_name. They are left out of the table below. SFTP is not TLS: its key_file is an SSH private key and stays in the table. TCP uses them only with tls=true. UDP has no TLS. See TLS options.

Keys by protocol​

ProtocolSinceModesKeysGuide
http10.1.0-only the TLS keysGuide
http20.1.0-only the TLS keysGuide
grpc0.1.0-only the TLS keysGuide
websocket0.1.0-only the TLS keysGuide
mqtt0.6.0publish, subscribe, roundtripmode, topic, qos, retain, username, password_env, client_id, count, expect, keepaliveGuide
kafka0.6.0produce, consume, roundtrip, adminmode, topic, key, acks, compression, count, expect, from, action, partitions, replication, sasl, username, password_env, client_idGuide
postgres0.7.0-username, password_env, database, sslmode, application_name, pool, allow_writes, query_mode, args, min_rows, expect, max_rowsGuide
mysql0.7.0-username, password_env, database, tls, pool, allow_writes, query_mode, args, min_rows, expect, max_rowsGuide
redis0.7.0-username, password_env, database, tls, pool, protocol, allow_writes, allow_admin, transaction, args, min_rows, expect, max_rowsGuide
rabbitmq0.7.0publish, consume, roundtrip, adminmode, exchange, routing_key, queue, bind_key, count, confirm, mandatory, persistent, content_type, priority, expiration, headers, ack, prefetch, expect, action, durable, auto_delete, queue_type, exchange_type, username, password_env, vhost, tls, connection, channels, heartbeat, connection_name, allow_writes, allow_adminGuide
ftp0.7.0connect, download, upload, list, stat, delete, roundtripmode, path, size, fill, expect_size, expect_sha256, expect, limit, hidden, username, password_env, tls, tls_verify, tls_max, sessions, connection, data_host, epsv, allow_writes, allow_adminGuide
sftp0.9.0connect, download, upload, list, stat, delete, roundtripmode, path, size, fill, expect_size, expect_sha256, expect, limit, hidden, username, password_env, key_file, key_passphrase_env, host_key, connections, connection, allow_writes, allow_admin, concurrent_writesGuide
tcp0.6.0-escape, expect, max, read, tls, untilGuide
udp0.6.0-escape, expect, replyGuide

Write and admin guards​

Some protocols can change data on the target. Those calls are off unless you set a key:

  • allow_writes allows writes. Postgres, MySQL, Redis, RabbitMQ, FTP and SFTP have it.
  • allow_admin allows admin work. Redis, RabbitMQ, FTP and SFTP have it.

Without the key, VegaLoad refuses the call. Each guide says what is refused.

Do not put a password in an -opt value. Use password_env (or key_passphrase_env for SFTP). Its value is the name of an environment variable that holds the secret.