{"record":{"id":"372f95690d75ad54","repo":"t8y2/dbx","slug":"invalid-exchange-type-s-supported-types-direc","errorCode":null,"errorMessage":"Invalid exchange type '%s'. Supported types: direct, fanout, topic, headers","messagePattern":"Invalid exchange type '(.+?)'\\. Supported types: direct, fanout, topic, headers","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"agents/drivers/rabbitmq/operations.go","lineNumber":477,"sourceCode":"\tvhost := effectiveVhost(params, connection)\n\tif _, err := managementSend(connection, http.MethodDelete,\n\t\t\"/api/exchanges/\"+urlEncodeVhost(vhost)+\"/\"+urlEncodePathSegment(name), nil); err != nil {\n\t\treturn nil, err\n\t}\n\treturn okResult(), nil\n}\n\nfunc exchangeName(params jsonObject) (string, error) {\n\tname := stringOrEmpty(params, \"name\")\n\tif strings.TrimSpace(name) == \"\" {\n\t\treturn \"\", errors.New(\"name is required\")\n\t}\n\treturn name, nil\n}\n\nfunc validateExchangeType(exchangeType string) (string, error) {\n\tif _, ok := exchangeTypes[exchangeType]; !ok {\n\t\treturn \"\", fmt.Errorf(\"Invalid exchange type '%s'. Supported types: direct, fanout, topic, headers\", exchangeType)\n\t}\n\treturn exchangeType, nil\n}\n\nfunc assertExchangeDeletable(name string) error {\n\tif name == \"\" {\n\t\treturn errors.New(\"The default exchange cannot be deleted\")\n\t}\n\tif strings.HasPrefix(name, \"amq.\") {\n\t\treturn fmt.Errorf(\"The built-in exchange '%s' cannot be deleted\", name)\n\t}\n\treturn nil\n}\n\nfunc (s *server) listBindings(params jsonObject) (any, error) {\n\tconnection, err := s.requireConnectionConfig(params)\n\tif err != nil {\n\t\treturn nil, err","sourceCodeStart":459,"sourceCodeEnd":495,"githubUrl":"https://github.com/t8y2/dbx/blob/c0390bff16418b651f4728520d99adf8ce48829a/agents/drivers/rabbitmq/operations.go#L459-L495","documentation":"RabbitMQ only supports four exchange types: direct, fanout, topic, and headers. validateExchangeType rejects anything else before sending the exchange.declare frame to the broker, which itself would reject it.","triggerScenarios":"Calling createExchange with a type such as 'directx', 'topic ', 'x-consistent-hash' (a plugin type), or any misspelling of the four supported types.","commonSituations":"Typos in tooling/UI input, copying exchange types from other brokers (Kafka topics, ActiveMQ), or trying plugin exchange types without the plugin installed.","solutions":["Use one of: direct, fanout, topic, headers","Fix typos and surrounding whitespace in the exchange type value","If a plugin exchange type is genuinely needed, install the plugin and use the broker's own tooling — this driver does not support it"],"exampleFix":"// before\nawait client.createExchange({\"name\": \"events\", \"type\": \"topicx\"})\n// after\nawait client.createExchange({\"name\": \"events\", \"type\": \"topic\"})","handlingStrategy":"validation","validationCode":"const EXCHANGE_TYPES = new Set([\"direct\", \"fanout\", \"topic\", \"headers\"])\nfunction validExchangeType(t) { return EXCHANGE_TYPES.has(t) }","typeGuard":"function isExchangeType(v) {\n  return typeof v === \"string\" && [\"direct\",\"fanout\",\"topic\",\"headers\"].includes(v)\n}","tryCatchPattern":null,"preventionTips":["Validate exchange type against the enum at input boundaries","Trim and lowercase user-provided type strings before calling","Never assume plugin exchange types are supported by this driver"],"tags":["rabbitmq","validation","exchange"],"backgroundTag":"invalid-enum-value","analyzedSha":"c0390bff16418b651f4728520d99adf8ce48829a","analyzedAt":"2026-09-05T23:05:10.900Z","contentChangedAt":"2026-09-05T23:05:10.900Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}