t8y2/dbx · error
RabbitMQ queue arguments are immutable after declaration; de
Error message
RabbitMQ queue arguments are immutable after declaration; delete and re-declare the queue to change them
What it means
AMQP queue arguments (x-arguments like x-message-ttl, dead-letter settings) are fixed once a queue is declared; RabbitMQ rejects a re-declare with different arguments. The driver proactively rejects mq_alter_topic_config so callers get a clear message instead of a PRECONDITION_FAILED channel error.
Source
Thrown at agents/drivers/rabbitmq/main.go:176
s.closeClients()
return okResult(), true, nil
case "mq_list_topics":
result, err := s.listTopics(params)
return result, false, err
case "mq_create_topic":
result, err := s.createTopic(params)
return result, false, err
case "mq_delete_topic":
result, err := s.deleteTopic(params)
return result, false, err
case "mq_get_topic_stats":
result, err := s.getTopicStats(params)
return result, false, err
case "mq_get_topic_config":
result, err := s.getTopicConfig(params)
return result, false, err
case "mq_alter_topic_config":
return nil, false, errors.New("RabbitMQ queue arguments are immutable after declaration; delete and re-declare the queue to change them")
case "mq_purge_queue":
result, err := s.purgeQueue(params)
return result, false, err
case "mq_list_consumers":
result, err := s.listConsumers(params)
return result, false, err
case "mq_list_namespaces":
result, err := s.listNamespaces(params)
return result, false, err
case "mq_create_namespace":
result, err := s.createNamespace(params)
return result, false, err
case "mq_delete_namespace":
result, err := s.deleteNamespace(params)
return result, false, err
case "mq_list_exchanges":
result, err := s.listExchanges(params)
return result, false, errView on GitHub (pinned to c0390bff16)
Solutions
- Delete the queue (mq_delete_topic) and re-declare it with the new arguments
- Create a new queue with the desired arguments and migrate publishers/consumers to it
- Use a policy (rabbitmqctl set_policy) to apply settings like TTL/DLX without re-declaration
Example fix
// before
agent.Call("mq_alter_topic_config", map[string]any{"topic": "orders", "args": map[string]any{"x-message-ttl": 60000}})
// after
agent.Call("mq_delete_topic", map[string]any{"topic": "orders"})
agent.Call("mq_create_topic", map[string]any{"topic": "orders", "args": map[string]any{"x-message-ttl": 60000}}) Defensive patterns
Strategy: try-catch
Try / catch
_, err := agent.Call("mq_alter_topic_config", params)
if err != nil && strings.Contains(err.Error(), "immutable after declaration") {
// handle: delete + re-declare or use policies
} Prevention
- Never call alter-config on the RabbitMQ driver; branch per broker type
- Treat queue arguments as immutable in your provisioning code
- Use RabbitMQ policies for tunable settings like TTL/DLX
When it happens
Trigger: Calling the mq_alter_topic_config method against this RabbitMQ driver with any params — the method is unconditionally rejected in dispatch.
Common situations: Code shared between message brokers (e.g. Kafka/Redis drivers support config changes) hitting the RabbitMQ driver; attempting to change x-max-length or TTL on a live queue.
Related errors
- Object source is not supported
- Completion assistant search is not supported by this agent
- Object source is not supported
- Completion assistant search is not supported by this agent
- Object source is not supported
AI-assisted analysis of t8y2/dbx@c0390bff16 (2026-09-05).
Data as JSON: /api/errors/f82e90671ec69fb5.
Report an issue: GitHub.