GH-422 GH-606 Add support for normalizing structure-mode CE message

Normalizing in this context means converting it to binary-mode so the rest of the processing logic is the same.
Added support for canonical attribute names. Now, internally any attribute can be set as 'ce_' regardless where it came from are where it goes to as the frameork will be able to recognize both
Removed CloudEventMessageConverter
Renamed CloudEventAttributes to CloudEventAttributesHelperas it is better suited to what it actually does
This commit is contained in:
Oleg Zhurakousky
2020-11-16 12:06:33 +01:00
parent c31b7f1f20
commit ada16079ca
15 changed files with 325 additions and 362 deletions

View File

@@ -21,7 +21,7 @@ import java.util.function.Function;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.function.cloudevent.CloudEventAttributes;
import org.springframework.cloud.function.cloudevent.CloudEventAttributesHelper;
import org.springframework.cloud.function.cloudevent.CloudEventAttributesProvider;
import org.springframework.cloud.function.cloudevent.CloudEventMessageUtils;
import org.springframework.context.annotation.Bean;
@@ -90,7 +90,7 @@ public class CloudeventDemoApplication {
data.setVersion("2.0");
data.setReleaseDateAsString("01-10-2006");
CloudEventAttributes ceAttributes = CloudEventMessageUtils.get(ceMessage.getHeaders())
CloudEventAttributesHelper ceAttributes = CloudEventMessageUtils.get(ceMessage.getHeaders())
.setSource("https://interface21.com/")
.setType("com.interface21");