Interface CloudEventHeaderEnricher
-
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
@FunctionalInterface public interface CloudEventHeaderEnricher
Strategy that should be implemented by the user to help with outgoing Cloud Event headers.
NOTE: The provided instance ofCloudEventMessageBuilder
may or may not be initialized with default values, so it is the responsibility of the user to ensure that all required Cloud Events attributes are set. That said, Spring frameworks which utilize this interface will ensure that the providedCloudEventMessageBuilder
is initialized with default values, leaving you responsible to only set the attributes you need.
Once implemented, simply configure it as a bean and the framework will invoke it before the outbound Cloud Event Message is finalized.@Bean public CloudEventHeaderEnricher cloudEventHeaderEnricher() { return headers -> { return headers.setSource("https://interface21.com/").setType("com.interface21"); }; }
- Since:
- 3.1
- Author:
- Oleg Zhurakousky, Dave Syer
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description CloudEventMessageBuilder<?>
enrich(CloudEventMessageBuilder<?> messageBuilder)
Will provide access to an open instance ofCloudEventMessageBuilder
so you can add additional attributes and headers.
-
-
-
Method Detail
-
enrich
CloudEventMessageBuilder<?> enrich(CloudEventMessageBuilder<?> messageBuilder)
Will provide access to an open instance ofCloudEventMessageBuilder
so you can add additional attributes and headers.- Parameters:
messageBuilder
- open instance ofCloudEventMessageBuilder
- Returns:
- instance of
CloudEventMessageBuilder
-
-