Fix RSocket CloudEvents sample

This commit is contained in:
Oleg Zhurakousky
2021-01-27 15:29:16 +01:00
parent 41d80433e1
commit b2e783490c
3 changed files with 2 additions and 15 deletions

View File

@@ -178,13 +178,6 @@ public final class CloudEventMessageBuilder<T> {
else if (key.startsWith(CloudEventMessageUtils.KAFKA_ATTR_PREFIX)) {
this.swapPrefix(key, CloudEventMessageUtils.KAFKA_ATTR_PREFIX, attributePrefixToUse);
}
// else if (key.equals(CloudEventMessageUtils._SPECVERSION) ||
// key.equals(CloudEventMessageUtils._SOURCE) || key.equals(CloudEventMessageUtils._TYPE) ||
// key.equals(CloudEventMessageUtils._DATASCHEMA) || key.equals(CloudEventMessageUtils._SCHEMAURL) ||
// key.equals(CloudEventMessageUtils._SUBJECT) || key.equals(CloudEventMessageUtils._TIME) ||
// key.equals(CloudEventMessageUtils._DATACONTENTTYPE)) {
// this.swapPrefix(key, "", attributePrefixToUse);
// }
}
}
return doBuild(attributePrefixToUse);

View File

@@ -389,14 +389,6 @@ public class RSocketAutoConfigurationTests {
.as(StepVerifier::create)
.expectComplete()
.verify();
// applicationContext.getBean(SampleFunctionConfiguration.class).consumerData
// .asMono()
// .map(String::new)
// .as(StepVerifier::create)
// .expectNext("\"hello\"")
// .expectComplete()
// .verify();
}
}

View File

@@ -18,6 +18,7 @@ import org.springframework.cloud.function.cloudevent.CloudEventMessageUtils;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.messaging.Message;
import org.springframework.messaging.rsocket.RSocketRequester;
import org.springframework.util.MimeTypeUtils;
@SpringBootTest(properties = {"spring.rsocket.server.port=55555"})
@@ -45,6 +46,7 @@ public class DemoApplicationTests {
this.rsocketRequesterBuilder.tcp("localhost", 55555)
.route("hire")
.metadata("{\"content-type\":\"application/cloudevents+json\"}", MimeTypeUtils.APPLICATION_JSON)
.data(payload)
.send()
.subscribe();