Fix function definition property (#91)

* Remove deprecated spring.cloud.stream.function.definition property

* Restore tasklauncher-function

Co-authored-by: David Turanski <dturanski@pivotal.io>
This commit is contained in:
David Turanski
2020-07-20 18:23:30 -04:00
committed by GitHub
parent d29a238569
commit 30caf06198
4 changed files with 10 additions and 44 deletions

View File

@@ -1,34 +0,0 @@
/*
* Copyright 2015-2020 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.cloud.fn.common.twitter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.condition.NoneNestedConditions;
/**
* @author Christian Tzolov
*/
public class OnMissingStreamFunctionDefinitionCondition extends NoneNestedConditions {
public OnMissingStreamFunctionDefinitionCondition() {
super(ConfigurationPhase.REGISTER_BEAN);
}
@ConditionalOnProperty(name = "spring.cloud.stream.function.definition")
static class OnFunctionDslProperty {
}
}

View File

@@ -37,7 +37,7 @@ import org.springframework.beans.factory.annotation.Autowired;
/**
* Bootstraps a Netty server using the {@link WebsocketConsumerServerInitializer}. Also adds
* a {@link LoggingHandler} and uses the <tt>logLevel</tt>
* a {@link LoggingHandler} and uses the <code>logLevel</code>
* from {@link WebsocketConsumerProperties#logLevel}.
*
* @author Oliver Moser

View File

@@ -54,7 +54,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false",
"spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.cloud.function.definition=taskLaunchRequestFunction",
"task.launch.request.task-name=foo")
.run();
@@ -70,7 +70,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
public void dataflowTaskLaunchRequestWithArgsAndDeploymentProperties() throws IOException {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false", "spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.jmx.enabled=false", "spring.cloud.function.definition=taskLaunchRequestFunction",
"task.launch.request.task-name=foo", "task.launch.request.args=foo=bar,baz=boo",
"task.launch.request.deploymentProperties=count=3")
.run();
@@ -87,7 +87,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
public void taskLaunchRequestWithCommandLineArgsMessageMapper() throws IOException {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false", "spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.jmx.enabled=false", "spring.cloud.function.definition=taskLaunchRequestFunction",
"task.launch.request.task-name=foo", "enhanceTLRArgs=true")
.run();
@@ -104,7 +104,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
public void taskLaunchRequestWithArgExpressions() throws IOException {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false",
"spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.cloud.function.definition=taskLaunchRequestFunction",
"task.launch.request.task-name=foo",
"task.launch.request.arg-expressions=foo=payload.toUpperCase(),bar=payload.substring(0,2)")
.run();
@@ -124,7 +124,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
@DirtiesContext
public void taskLaunchRequestWithIntPayload() throws IOException {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false", "spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.jmx.enabled=false", "spring.cloud.function.definition=taskLaunchRequestFunction",
"task.launch.request.task-name=foo",
"task.launch.request.arg-expressions=i=payload")
.run();
@@ -145,7 +145,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
@DirtiesContext
public void taskNameExpression() throws IOException {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false", "spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.jmx.enabled=false", "spring.cloud.function.definition=taskLaunchRequestFunction",
"task.launch.request.task-name-expression=payload+'_task'")
.run();
@@ -164,7 +164,7 @@ public class TaskLaunchRequestFunctionApplicationTests {
@DirtiesContext
public void customTaskNameExtractor() throws IOException {
ApplicationContext context = springApplicationBuilder.properties(
"spring.jmx.enabled=false", "spring.cloud.stream.function.definition=taskLaunchRequestFunction",
"spring.jmx.enabled=false", "spring.cloud.function.definition=taskLaunchRequestFunction",
"customTaskNameExtractor=true")
.run();
TaskLaunchRequestFunction taskLaunchRequestFunction = context.getBean(TaskLaunchRequestFunction.class);

View File

@@ -55,7 +55,7 @@ public class MyTwitterTrendBootApp {
public static void main(String[] args) {
SpringApplication.run(MyTwitterTrendBootApp.class,
"--spring.cloud.stream.function.definition=trend|twitterTrendFunction|managedJson");
"--spring.cloud.function.definition=trend|twitterTrendFunction|managedJson");
}
}
----
@@ -110,7 +110,7 @@ public class MyTwitterGeoProcessorBootApp {
public static void main(String[] args) {
SpringApplication.run(MyTwitterGeoProcessorBootApp.class,
"--spring.cloud.stream.function.definition=messageToGeoQueryFunction|twitterSearchPlacesFunction|managedJson");
"--spring.cloud.function.definition=messageToGeoQueryFunction|twitterSearchPlacesFunction|managedJson");
}
}
----