Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@bergundy
Copy link
Member

@bergundy bergundy commented Oct 3, 2025

No description provided.

spkane31 and others added 6 commits October 3, 2025 10:49
* The `temporal activity {pause,update-options}` support batch
operations through `--query`
* Consistently passing the `--identity` parameter to server requests

Improved developer experience, can batch these requests through a
visibility query instead of sending multiple requests

2. How was this tested:
New unit tests

3. Any docs updates needed?
Documentation updates are automatically generated with releases.
Not changing the actual default, just what is printed in the help
output.
<!--- Note to EXTERNAL Contributors -->
<!-- Thanks for opening a PR! 
If it is a significant code change, please **make sure there is an open
issue** for this.
We work best with you when we have accepted the idea first before you
code. -->

<!--- For ALL Contributors 👇 -->

## What was changed
+ Added a new `report-config` field in the describe command to retrieve
updated task queue configs if exists.
+ Implement display logic for config table along with truncation of
large update reasons or update identities.
**Note : These changes are only a part of the legacy mode of the
describeTaskQueueApi.**

```
./temporal task-queue describe \                                                               
 --task-queue=test-display-queue \
 --task-queue-type-legacy=activity \
 -n=default \
 --report-config \
 --legacy-mode
```

Sample Response
```
./temporal task-queue describe \
 --task-queue=hello-world \
 --task-queue-type-legacy=activity \
 -n=default \
 --report-config \
 --legacy-mode
Pollers:
  Identity  LastAccessTime  RatePerSecond

Task Queue Configuration:
Note: Long content may be truncated. Use --output json for full details.
              Setting                     Value              Reason        UpdatedBy       UpdatedTime    
  Fairness Key Rate Limit Default  100 requests/second  Fairness key test  api-tester  2025-08-12 04:31:46
```

---

+ Added separate config Subcommand for getting/setting configs.
```
./temporal task-queue config --help  
Manage Task Queue configuration:

temporal task-queue config [command] [options]

Available commands:
- get: Retrieve the current configuration for a task queue
- set: Update the configuration for a task queue

Usage:
  temporal task-queue config [command]

Available Commands:
  get         Get Task Queue configuration
  set         Set Task Queue configuration
```
---

+ Get Subcommand
```
./temporal task-queue config get --help
Retrieve the current configuration for a Task Queue:

temporal task-queue config get \
    --task-queue YourTaskQueue \
    --task-queue-type activity

This command returns the current configuration including:
- Queue rate limit: The overall rate limit of the task queue.
  This setting overrides the worker rate limit if set.
  Unless modified, this is the system-defined rate limit.
- Fairness key rate limit defaults: Default rate limits for fairness keys.
  If set, each individual fairness key will be limited to this rate,
  scaled by the weight of the fairness key.

Usage:
  temporal task-queue config get [flags]
```
Sample Response
```
./temporal task-queue config get \
  --task-queue=hello-world \
  --task-queue-type=activity \
  --namespace=default
Note: Long content may be truncated. Use --output json for full details.
              Setting                     Value              Reason        UpdatedBy       UpdatedTime    
  Fairness Key Rate Limit Default  100 requests/second  Fairness key test  api-tester  2025-08-12 04:31:46
```

---

+ Set Subcommand
```
./temporal task-queue config set --help
Update a Task Queue's overall rate limit and the default rate limit for all fairness keys:

temporal task-queue config set \
    --task-queue YourTaskQueue \
    --task-queue-type activity \
    --namespace YourNamespace \
    --queue-rps-limit <requests_per_second:float> \
    --queue-rps-limit-reason <reason_string> \
    --fairness-key-rps-limit-default <requests_per_second:float> \
    --fairness-key-rps-limit-reason <reason_string>

This command supports updating:
- Queue rate limits: Controls the overall rate limit of the task queue.
  This setting overrides the worker rate limit if set.
  Unless modified, this is the system-defined rate limit.
- Fairness key rate limit defaults: Sets default rate limits for fairness keys.
  If set, each individual fairness key will be limited to this rate,
  scaled by the weight of the fairness key.

To unset a rate limit, pass in 'default', for example: --queue-rps-limit default

Usage:
  temporal task-queue config set [flags]

Flags:
      --fairness-key-rps-limit-default float|default   Fairness key rate limit default in requests per second. Accepts a float; or 'default' to unset.
      --fairness-key-rps-limit-reason string           Reason for fairness key rate limit update.
  -h, --help                                           help for set
      --queue-rps-limit float|default                  Queue rate limit in requests per second. Accepts a float; or 'default' to unset.
      --queue-rps-limit-reason string                  Reason for queue rate limit update.
  -t, --task-queue string                              Task Queue name. Required.
      --task-queue-type string                         Task Queue type. Accepted values: workflow, activity, nexus. Accepted values: workflow, activity, nexus. Required.
```
   

Sample response : 
```
./temporal task-queue config set \
  --task-queue=hello-world \
  --task-queue-type=activity \
  --fairness-key-rps-limit-default=100 \
  --fairness-key-rps-limit-reason="Fairness key test" \
  --identity="api-tester" \
  --namespace=default
Successfully updated task queue configuration
  Config  {"fairnessKeysRateLimitDefault":{"rateLimit":{"requestsPerSecond":100},"metadata":{"reason":"Fairness key test","updateIdentity":"api-tester","updateTime":"2025-08-12T04:31:46.640Z"}}}
```

## Why?
+ Cli support for `UpdateTaskQueueConfig` api - new api that allows
updates of rate limits against task queues.

## Checklist

1. How was this tested:
+ Added tests.

2. Any docs updates needed?
Pending.

---------

Co-authored-by: Stephan Behnke <[email protected]>
Co-authored-by: Stephan Behnke <[email protected]>
@bergundy bergundy requested review from a team as code owners October 3, 2025 18:28
@bergundy
Copy link
Member Author

bergundy commented Oct 3, 2025

I forgot to codegen before force pushing the branch, the fix is included here: #857

@bergundy bergundy merged commit 4113c11 into main Oct 6, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants