renamed bytecode resource property
This commit is contained in:
@@ -17,19 +17,19 @@ while getopts ":i:s:f:c:o:p:" opt; do
|
|||||||
s)
|
s)
|
||||||
FUNC=$OPTARG
|
FUNC=$OPTARG
|
||||||
TYPE="$PREFIX.$FUNC.type=supplier"
|
TYPE="$PREFIX.$FUNC.type=supplier"
|
||||||
RESOURCE="$PREFIX.$FUNC.resource=$DIR/suppliers/$FUNC.fun"
|
RESOURCE="$PREFIX.$FUNC.bytecode=$DIR/suppliers/$FUNC.fun"
|
||||||
;;
|
;;
|
||||||
f)
|
f)
|
||||||
FUNC=$OPTARG
|
FUNC=$OPTARG
|
||||||
for i in `tokenize $OPTARG`; do
|
for i in `tokenize $OPTARG`; do
|
||||||
RESOURCE="$RESOURCE $PREFIX.${i}.resource=$DIR/functions/${i}.fun"
|
RESOURCE="$RESOURCE $PREFIX.${i}.bytecode=$DIR/functions/${i}.fun"
|
||||||
TYPE="$TYPE $PREFIX.${i}.type=function"
|
TYPE="$TYPE $PREFIX.${i}.type=function"
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
c)
|
c)
|
||||||
FUNC=$OPTARG
|
FUNC=$OPTARG
|
||||||
TYPE="$PREFIX.$FUNC.type=consumer"
|
TYPE="$PREFIX.$FUNC.type=consumer"
|
||||||
RESOURCE="$PREFIX.$FUNC.resource=$DIR/consumers/$FUNC.fun"
|
RESOURCE="$PREFIX.$FUNC.bytecode=$DIR/consumers/$FUNC.fun"
|
||||||
;;
|
;;
|
||||||
o)
|
o)
|
||||||
OUT=--spring.cloud.stream.bindings.output.destination=$OPTARG
|
OUT=--spring.cloud.stream.bindings.output.destination=$OPTARG
|
||||||
|
|||||||
@@ -22,6 +22,6 @@ done
|
|||||||
|
|
||||||
java -jar ../spring-cloud-function-samples/spring-cloud-function-sample-compiler/target/function-sample-compiler-1.0.0.BUILD-SNAPSHOT.jar\
|
java -jar ../spring-cloud-function-samples/spring-cloud-function-sample-compiler/target/function-sample-compiler-1.0.0.BUILD-SNAPSHOT.jar\
|
||||||
--spring.cloud.function.proxy.$FUNC.type=$TYPE\
|
--spring.cloud.function.proxy.$FUNC.type=$TYPE\
|
||||||
--spring.cloud.function.proxy.$FUNC.resource=file:///tmp/function-registry/$TYPE's'/$FUNC.fun\
|
--spring.cloud.function.proxy.$FUNC.bytecode=file:///tmp/function-registry/$TYPE's'/$FUNC.fun\
|
||||||
--management.security.enabled=false\
|
--management.security.enabled=false\
|
||||||
--server.port=$PORT
|
--server.port=$PORT
|
||||||
|
|||||||
@@ -59,13 +59,13 @@ public class FunctionProxyApplicationListener implements ApplicationListener<App
|
|||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Map<String, String> properties = (Map<String, String>) entry.getValue();
|
Map<String, String> properties = (Map<String, String>) entry.getValue();
|
||||||
String type = (properties.get("type") != null) ? properties.get("type") : "function";
|
String type = (properties.get("type") != null) ? properties.get("type") : "function";
|
||||||
String resource = properties.get("resource");
|
String bytecodeResource = properties.get("bytecode");
|
||||||
String lambda = properties.get("lambda");
|
String lambda = properties.get("lambda");
|
||||||
if (!(null == resource ^ null == lambda)) {
|
if (!(null == bytecodeResource ^ null == lambda)) {
|
||||||
throw new IllegalArgumentException("Exactly one of 'resource' or 'lambda' is required for a Function proxy");
|
throw new IllegalArgumentException("Exactly one of 'bytecode' or 'lambda' is required for a Function proxy");
|
||||||
}
|
}
|
||||||
if (resource != null) {
|
if (bytecodeResource != null) {
|
||||||
registerByteCodeLoadingProxy(name, type, context.getResource(resource), beanFactory);
|
registerByteCodeLoadingProxy(name, type, context.getResource(bytecodeResource), beanFactory);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
registerLambdaCompilingProxy(name, type, lambda, beanFactory);
|
registerLambdaCompilingProxy(name, type, lambda, beanFactory);
|
||||||
|
|||||||
Reference in New Issue
Block a user