Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.Ce contenu n'est pas disponible dans la langue sélectionnée.
56.7. Extra Options
Overview Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
The
extraOptions options are usually used to either compute or hide complex API parameters by providing simpler options instead. For example, the API method might take a POJO option, that could be provided more easily as parts of the POJO in the URI. The component could do this by adding the parts as extra options, and creating the POJO parameter internally. To complete the implementation of these extra options, you also need to override the interceptProperties method in the EndpointConsumer and/or EndpointProducer classes (see Section 55.4, “Programming Model”).
Syntax Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
The
extraOptions element can be defined with one or more extraOption child elements, as follows:
Where
TypeName is the fully-qualified type name of the extra option and OptionName is the name of the extra URI option.
Scope Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
As shown in the following extract, the
extraOptions element can optionally appear as a child of the apis element and/or as a child of api elements:
You can define the
extraOptions element at the following scopes:
- As a child of an
apielement—theextraOptionsapply only to the API class specified by theapielement. - As a child of the
apiselement—theextraOptionsapply to all API classes by default, but can be overridden at theapilevel.
Child elements Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
Each
extraOptions element can be defined with the following child elements:
type- Specifies the fully-qualified type name of the extra option.
name- Specifies the option name, as it would appear in an endpoint URI.
Example Copier lienLien copié sur presse-papiers!
Copier lienLien copié sur presse-papiers!
The following example defines an extra URI option,
customOption, which is of java.util.list<String> type: