Updated on December 13, 2021
Configure Orchestrate Transaction Sender
Follow these steps to configure and connect to Orchestrate Transaction Sender dependencies:
- Configure Apache Kafka (mandatory)
- Configure Redis (optional). Use a persistent cache (recommended).
- Configure monitoring (optional). Improve the development experience and debugging.
- Configure Multi-tenancy (optional). Use Orchestrate with multiple tenants.
In addition to the dependencies, Orchestrate Transaction Sender needs to be configured to connect to the other microservices and to define how the service should be exposed.
Tip
Configure each microservice using microservice-specific environment variables. Command line options are also available and take precedence over environment variables.
Configuration
Environment Variable | Command line option | Description | Default |
---|---|---|---|
API_URL |
api-url |
URL of the Gateway API HTTP endpoint. | localhost:8081 |
API_METRICS_URL |
(only ENV var) | URL of the Gateway API HTTP metrics endpoint. | localhost:8082 |
KEY_MANAGER_URL |
key-manager-url |
URL of the Key Manager HTTP endpoint. | |
NONCE_MAX_RECOVERY |
nonce-max-recovery |
Maximum number of tries to recover a transaction with invalid nonce before returning an error. | 5 |
NONCE_MANAGER_TYPE |
nonce-manager-type |
Type of the nonce manager cache. Can be in-memory or redis |
redis |
CLI options
See the complete list of command line options for the Orchestrate Transaction Sender:
Usage:
orchestrate tx-sender run [flags]
Flags:
--api-url string URL of the API HTTP endpoint. Environment variable: "API_URL" (default "http://localhost:8081")
--auth-api-key string Key used for authentication (it should be used only for Orchestrate internal authenetication).
Environment variable: "AUTH_API_KEY"
--consumer-group-name string Kafka consumer group name
Environment variable: "KAFKA_CONSUMER_GROUP_NAME" (default "group-sender")
-h, --help help for run
--kafka-consumer-group-heartbeat-interval duration The expected time between heartbeats to the consumer coordinator when using Kafka's group management facilities. Heartbeats are used to ensure that the consumer's session stays active and to facilitate rebalancing when new consumers join or leave the group.
Environment variable: "KAFKA_CONSUMER_GROUP_HEARTBEAT_INTERVAL" in ms (default 3s)
--kafka-consumer-group-rebalance-strategy string Strategy for allocating topic partitions to members (one of ["Range" "RoundRobin" "Sticky"]).
Environment variable: "KAFKA_CONSUMER_GROUP_REBALANCE_STRATEGY" (default "Range")
--kafka-consumer-group-rebalance-timeout duration The maximum allowed time for each worker to join the group once a rebalance has begun. This is basically a limit on the amount of time needed for all tasks to flush any pending data and commit offsets. If the timeout is exceeded, then the worker will be removed from the group, which will cause offset commit failures
Environment variable: "KAFKA_CONSUMER_GROUP_REBALANCE_TIMEOUT" (default 1m0s)
--kafka-consumer-group-session-timeout duration The timeout used to detect consumer failures when using Kafka's group management facility. The consumer sends periodic heartbeats to indicate its liveness to the broker. If no heartbeats are received by the broker before the expiration of this session timeout, then the broker will remove this consumer from the group and initiate a rebalance.
Environment variable: "KAFKA_CONSUMER_GROUP_SESSION_TIMEOUT" (default 10s)
--kafka-consumer-max-processing-time duration The maximum amount of time the consumer expects a message takes to process for the user. If writing to the Messages channel takes longer than this, that partition will stop fetching more messages until it can proceed again.
Environment variable: "KAFKA_CONSUMER_MAXPROCESSINGTIME" (default 100ms)
--kafka-consumer-max-wait-time duration The maximum amount of time the broker will wait for Consumer.Fetch.Min bytes to become available before it returns fewer than that anyways.
Environment variable: "KAFKA_CONSUMER_MAX_WAIT_TIME" in ms (default 250ms)
--kafka-consumers uint8 Number of parallel kafka consumers to initialize.
Environment variable: "KAFKA_NUM_CONSUMERS" (default 1)
--kafka-sasl-enabled Whether or not to use SASL authentication when connecting to the broker
Environment variable: "KAFKA_SASL_ENABLED"
--kafka-sasl-handshake Whether or not to send the Kafka SASL handshake first if enabled (defaults to true). You should only set this to false if you're using a non-Kafka SASL proxy.
Environment variable: "KAFKA_SASL_HANDSHAKE" (default true)
--kafka-sasl-mechanism string SASLMechanism is the name of the enabled SASL mechanism. Possible values: OAUTHBEARER, PLAIN (defaults to PLAIN).
Environment variable: "KAFKA_SASL_MECHANISM"
--kafka-sasl-password string Password for SASL/PLAIN or SASL/SCRAM auth.
Environment variable: "KAFKA_SASL_PASSWORD"
--kafka-sasl-scramauthzid string Authz id used for SASL/SCRAM authentication
Environment variable: "KAFKA_SASL_SCRAMAUTHZID"
--kafka-sasl-user string Username for SASL/PLAIN or SASL/SCRAM auth.
Environment variable: "KAFKA_SASL_USER"
--kafka-tls-ca-cert-file string CA cert file Path.
Environment variable: "KAFKA_TLS_CA_CERT_FILE"
--kafka-tls-client-cert-file string Client Cert File Path.
Environment variable: "KAFKA_TLS_CLIENT_CERT_FILE"
--kafka-tls-client-key-file string Client key file Path.
Environment variable: "KAFKA_TLS_CLIENT_KEY_FILE"
--kafka-tls-enabled Whether or not to use TLS when connecting to the broker (defaults to false).
Environment variable: "KAFKA_TLS_ENABLED"
--kafka-tls-insecure-skip-verify Controls whether a client verifies the server's certificate chain and host name. If InsecureSkipVerify is true, TLS accepts any certificate presented by the server and any host name in that certificate. In this mode, TLS is susceptible to man-in-the-middle attacks. This should be used only for testing.
Environment variable: "KAFKA_TLS_INSECURE_SKIP_VERIFY"
--kafka-url strings URL (addresses) of Kafka server(s) to connect to.
Environment variable: "KAFKA_URL" (default [localhost:9092])
--kafka-version string The version of Kafka that Sarama will assume it is running against. Defaults to the oldest supported stable version. Since Kafka provides backwards-compatibility, setting it to a version older than you have will not break anything, although it may prevent you from using the latest features. Setting it to a version greater than you are actually running may lead to random breakage.
Environment variable: "KAFKA_CONSUMER_GROUP_REBALANCE_TIMEOUT" (default "1.0.0")
--key-manager-api-key string Key Manager API-KEY authentication.
Environment variable: "KEY_MANAGER_API_KEY"
--key-manager-client-tls-cert string Key Manager mutual TLS authentication (crt file).
Environment variable: "KEY_MANAGER_CLIENT_TLS_CERT"
--key-manager-client-tls-key string Key Manager mutual TLS authentication (key file).
Environment variable: "KEY_MANAGER_CLIENT_TLS_KEY"
--key-manager-metrics-url string Key Manager HTTP metrics domain.
Environment variable: "KEY_MANAGER_METRICS_URL"
--key-manager-store-name string Key Manager ethereum account store name.
Environment variable: "KEY_MANAGER_STORE_NAME"
--key-manager-tls-skip-verify Key Manager, disables SSL certificate verification.
Environment variable: "KEY_MANAGER_TLS_SKIP_VERIFY"
--key-manager-url string Key Manager HTTP domain.
Environment variable: "KEY_MANAGER_URL"
--log-format string Log formatter (one of ["text" "json"]).
Environment variable: "LOG_FORMAT" (default "text")
--log-level string Log level (one of ["panic" "fatal" "error" "warn" "info" "debug" "trace"]).
Environment variable: "LOG_LEVEL" (default "info")
--log-timestamp Enable logging with timestamp (only TEXT format).
Environment variable: "LOG_TIMESTAMP"
--metrics-hostname string Hostname to expose metrics services
Environment variable: "METRICS_HOSTNAME"
--metrics-modules strings List of metrics modules exposed. Available metric modules are ["tcp" "go" "process" "healthz"], to enable all use ENABLED or to disable all DISABLED.
Environment variable: "METRICS_MODULES" (default [ENABLED])
--metrics-port uint Port to expose metrics services
Environment variable: "METRICS_PORT" (default 8082)
--nonce-manager-expiration duration Nonce manager cache expiration time (TTL).
Environment variable: "NONCE_MANAGER_EXPIRATION" (default 5m0s)
--nonce-manager-type string Type of Nonce manager cache (one of ["in-memory" "redis"])
Environment variable: "NONCE_MANAGER_TYPE" (default "redis")
--nonce-max-recovery int Maximum number of times to try to recover a transaction with invalid nonce before returning an error.
Environment variable: "NONCE_MAX_RECOVERY" (default 5)
--redis-database int Target Redis database name
Environment variable: "REDIS_DATABASE" (default -1)
--redis-host string Host (address) of Redis server to connect to.
Environment variable: "REDIS_HOST" (default "localhost")
--redis-password string Redis Username password
Environment variable: "REDIS_PASSWORD"
--redis-port string Port (address) of Redis server to connect to.
Environment variable: "REDIS_PORT" (default "6379")
--redis-tls-ca string Trusted Certificate Authority
Environment variable: "REDIS_TLS_CA"
--redis-tls-cert string TLS Certificate to connect to Redis
Environment variable: "REDIS_TLS_CERT"
--redis-tls-enable Enable TLS/SSL to connect to Redis
Environment variable: "REDIS_TLS_ENABLE"
--redis-tls-key string TLS Private Key to connect to Redis
Environment variable: "REDIS_TLS_KEY"
--redis-tls-skip-verify Skip service certificate verification
Environment variable: "REDIS_TLS_SKIP_VERIFY"
--redis-user string Redis Username.
Environment variable: "REDIS_USER"
--topic-tx-recover string Topic for failed transaction messages.
Environment variable: "TOPIC_TX_RECOVER" (default "topic-tx-recover")
--topic-tx-sender string Topic for messages between the API and the Tx-Sender.