Files
spring-cloud-gateway/docs/modules/ROOT/pages/spring-cloud-gateway-server-webflux/route-metadata-configuration.adoc
Spencer Gibb 037abaeb26 New module names (#3645)
* New naming convention using webflux and webmvc

The new suffixes are gateway-server-web{flux|mvc} and gateway-proxyexchange-web{flux|mvc}.

This commit updates the starters to use gateway-server-web{flux|mvc} suffixes.

* Adds new spring-cloud-gateway-server-web{flux|mvc} modules.

These simply depend on the old ones. A warning is logged if not using the new module.

* Adds s-c-g-proxyexchange-{webflux|webmvc} modules

* Updates docs for  s-c-g-{proxyexchange|server}-{webflux|webmvc} modules
2025-01-16 21:26:10 -05:00

33 lines
697 B
Plaintext

[[route-metadata-configuration]]
= Route Metadata Configuration
You can configure additional parameters for each route by using metadata, as follows:
.application.yml
[source,yaml]
----
spring:
cloud:
gateway:
routes:
- id: route_with_metadata
uri: https://example.org
metadata:
optionName: "OptionValue"
compositeObject:
name: "value"
iAmNumber: 1
----
You could acquire all metadata properties from an exchange, as follows:
[source]
----
Route route = exchange.getAttribute(GATEWAY_ROUTE_ATTR);
// get all metadata properties
route.getMetadata();
// get a single metadata property
route.getMetadata(someKey);
----