Change name of property endpoint -> defaultRoute
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
spring.cloud.stream.bindings.input.destination: foos
|
||||
spring.cloud.stream.bindings.output.destination: bars
|
||||
spring.cloud.function.stream.endpoint: uppercase
|
||||
spring.cloud.function.stream.default-route: uppercase
|
||||
management.security.enabled: false
|
||||
@@ -1,2 +1,2 @@
|
||||
spring.cloud.function.stream.endpoint: uppercase
|
||||
spring.cloud.function.stream.default-route: uppercase
|
||||
spring.cloud.function.scan.packages: com.example.functions
|
||||
@@ -60,7 +60,7 @@ public class StreamConfiguration {
|
||||
FunctionInspector functionInspector,
|
||||
@Lazy CompositeMessageConverterFactory compositeMessageConverterFactory) {
|
||||
return new StreamListeningFunctionInvoker(registry, functionInspector,
|
||||
compositeMessageConverterFactory, properties.getEndpoint());
|
||||
compositeMessageConverterFactory, properties.getDefaultRoute());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -24,7 +24,11 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
@ConfigurationProperties(prefix = "spring.cloud.function.stream")
|
||||
public class StreamConfigurationProperties {
|
||||
|
||||
private String endpoint;
|
||||
/**
|
||||
* The default route for a message if more than one is available and no explicit route
|
||||
* key is provided.
|
||||
*/
|
||||
private String defaultRoute;
|
||||
|
||||
/**
|
||||
* Interval to be used for the Duration (in milliseconds) of a non-Flux producing
|
||||
@@ -34,12 +38,12 @@ public class StreamConfigurationProperties {
|
||||
|
||||
public static final String ROUTE_KEY = "stream_routekey";
|
||||
|
||||
public String getEndpoint() {
|
||||
return endpoint;
|
||||
public String getDefaultRoute() {
|
||||
return defaultRoute;
|
||||
}
|
||||
|
||||
public void setEndpoint(String endpoint) {
|
||||
this.endpoint = endpoint;
|
||||
public void setDefaultRoute(String defaultRoute) {
|
||||
this.defaultRoute = defaultRoute;
|
||||
}
|
||||
|
||||
public long getInterval() {
|
||||
|
||||
@@ -55,7 +55,7 @@ public class StreamListeningFunctionInvoker implements SmartInitializingSingleto
|
||||
|
||||
private MessageConverter converter;
|
||||
|
||||
private final String defaultEndpoint;
|
||||
private final String defaultRoute;
|
||||
|
||||
private final Map<String, FluxMessageProcessor> processors = new HashMap<>();
|
||||
|
||||
@@ -67,11 +67,11 @@ public class StreamListeningFunctionInvoker implements SmartInitializingSingleto
|
||||
|
||||
public StreamListeningFunctionInvoker(FunctionCatalog functionCatalog,
|
||||
FunctionInspector functionInspector,
|
||||
CompositeMessageConverterFactory converterFactory, String defaultEndpoint) {
|
||||
CompositeMessageConverterFactory converterFactory, String defaultRoute) {
|
||||
this.functionCatalog = functionCatalog;
|
||||
this.functionInspector = functionInspector;
|
||||
this.converterFactory = converterFactory;
|
||||
this.defaultEndpoint = defaultEndpoint;
|
||||
this.defaultRoute = defaultRoute;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -137,8 +137,8 @@ public class StreamListeningFunctionInvoker implements SmartInitializingSingleto
|
||||
.get(StreamConfigurationProperties.ROUTE_KEY);
|
||||
name = stash(key);
|
||||
}
|
||||
if (name==null && defaultEndpoint != null) {
|
||||
name = stash(defaultEndpoint);
|
||||
if (name==null && defaultRoute != null) {
|
||||
name = stash(defaultRoute);
|
||||
}
|
||||
if (name == null) {
|
||||
Set<String> names = new LinkedHashSet<>(functionCatalog.getFunctionNames());
|
||||
|
||||
@@ -44,7 +44,7 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
@RunWith(SpringRunner.class)
|
||||
@SpringBootTest(classes = PojoStreamingExplicitEndpointTests.StreamingFunctionApplication.class, properties = {
|
||||
"spring.cloud.function.stream.endpoint=uppercase",
|
||||
"spring.cloud.function.stream.default-route=uppercase",
|
||||
"logging.level.org.springframework.integration=DEBUG", "debug=TRUE" })
|
||||
public class PojoStreamingExplicitEndpointTests {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user