Skip to content

Commit

Permalink
update web.sh and README
Browse files Browse the repository at this point in the history
  • Loading branch information
markfisher committed Feb 7, 2017
1 parent 9eb3b03 commit 62aecb9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
13 changes: 7 additions & 6 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Also, start a RabbitMQ server locally (e.g. execute `rabbitmq-server`).

----
./web.sh -f uppercase -p 9000
curl -H "Content-Type: text/plain" -H "Accept: text/plain" :9000/function -d foo
curl -H "Content-Type: text/plain" -H "Accept: text/plain" :9000/uppercase -d foo
----

=== Register a Supplier:
Expand All @@ -150,7 +150,7 @@ curl -H "Content-Type: text/plain" -H "Accept: text/plain" :9000/function -d foo

----
./web.sh -s words -p 9001
curl -H "Accept: application/json" :9001/supplier
curl -H "Accept: application/json" :9001/words
----

=== Register a Consumer:
Expand All @@ -163,7 +163,7 @@ curl -H "Accept: application/json" :9001/supplier

----
./web.sh -c print -p 9002
curl -X POST -H "Content-Type: text/plain" -d foo :9002/consumer
curl -X POST -H "Content-Type: text/plain" -d foo :9002/print
----

=== Run Stream Processing Microservices:
Expand All @@ -174,12 +174,13 @@ First register a streaming words supplier:
./registerSupplier.sh -n wordstream -f "()->Flux.intervalMillis(1000).map(i->\"message-\"+i)"
----

Then start the source (supplier), processor (function), and sink (consumer) apps:
Then start the source (supplier), processor (function), and sink (consumer) apps
(in reverse order):

----
./stream.sh -p 9101 -s wordstream -o words
./stream.sh -p 9102 -i words -f uppercase -o uppercaseWords
./stream.sh -p 9103 -i uppercaseWords -c print
./stream.sh -p 9102 -i words -f uppercase -o uppercaseWords
./stream.sh -p 9101 -s wordstream -o words
----

The output will appear in the console of the sink app (one message per second, converted to uppercase):
Expand Down
9 changes: 5 additions & 4 deletions scripts/web.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ while getopts ":s:f:c:p:" opt; do
esac
done

java -jar ../spring-cloud-function-samples/spring-cloud-function-sample-bytecode/target/function-sample-bytecode-1.0.0.BUILD-SNAPSHOT.jar \
--function.type=$TYPE \
--function.resource=file:///tmp/function-registry/$TYPE's'/$FUNC.fun \
--server.port=$PORT
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.resource=file:///tmp/function-registry/$TYPE's'/$FUNC.fun\
--management.security.enabled=false\
--server.port=$PORT

0 comments on commit 62aecb9

Please sign in to comment.