Contact Us 1-800-596-4880

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:

@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 results in an error.