Dave Syer 452106f287 Fix some logic with media types
If user sends "Accept: */*" we don't want to default to sending
an SSE (for instance). So the logic for detecting those preferences
has to take MediaType.ALL into account as a special case.
2017-01-20 13:10:57 +00:00
2017-01-03 08:18:31 -05:00
2016-09-21 22:33:06 -04:00
2017-01-03 08:18:31 -05:00
2017-01-03 08:18:31 -05:00
2017-01-11 10:54:15 -05:00

To run these examples, change into the `scripts` directory:

----
cd scripts
----

== Start the Function Registry Service:

----
./function-registry.sh
----

== Register a Function:

----
./registerFunction.sh -n uppercase -f "f->f.map(s->s.toString().toUpperCase())"
----

== Run a REST Microservice using that Function:

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

== Register a Supplier:

----
./registerSupplier.sh -n words -f "()->Flux.just(\"foo\",\"bar\")"
----

== Run a REST Microservice using that Supplier:

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

== Register a Consumer:

----
./registerConsumer.sh -n print -f "System.out::println"
----

== Run a REST Microservice using that Consumer:

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

== Run Stream Processing Microservices:

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:

----
./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
----

The output will appear in the console of the sink app (one message per second, converted to uppercase):

----
MESSAGE-0
MESSAGE-1
MESSAGE-2
MESSAGE-3
MESSAGE-4
MESSAGE-5
MESSAGE-6
MESSAGE-7
MESSAGE-8
MESSAGE-9
...
----
Description
No description provided
Readme Apache-2.0 16 MiB
Languages
Java 99.5%
Shell 0.4%