Nav
You are viewing an older version of this topic. To go to a different version, use the version menu at the upper-right. +

Defining Parameters in a Message Source

Parameters are defined as fields of your Source class. All the features and annotations (such as @NullSafe, @ParameterGroup, @TypeResolver) are available when defining an operation, for example:


         
      
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
@EmitsResponse
public class HttpListener extends Source<InputStream, HttpRequestAttributes> {

    @Config
    private HttpListenerConfig config;

    @Parameter
    @Optional(defaultValue = "/")
    private String path;

    @Parameter
    private Integer port;

    /**
    * Comma separated list of allowed HTTP methods by this listener.
    */
    @Parameter
    @Optional
    @Placement(tab = Placement.ADVANCED_TAB)
    @Summary("Comma separated list of methods. Leave empty to allow all.")
    @Example("GET, POST")
    private String allowedMethods;
}

This is similar to how configs are defined, except that none of these parameters accept expressions. Using the @Expression annotation to support or require expression support will result in an error.

In this topic:

We use cookies to make interactions with our websites and services easy and meaningful, to better understand how they are used and to tailor advertising. You can read more and make your cookie choices here. By continuing to use this site you are giving us your consent to do this.

+