Skip to content

Commit

Permalink
Merge pull request #4306 from jaikiran/kafka-guide-doc
Browse files Browse the repository at this point in the history
Update the kafka-quickstart guide
  • Loading branch information
cescoffier authored Oct 2, 2019
2 parents 2547790 + d6f22ad commit a3fdfde
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions docs/src/main/asciidoc/kafka-guide.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,7 @@ import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;
import org.jboss.resteasy.annotations.SseElementType;
/**
* A simple resource retrieving the in-memory "my-data-stream" and sending the items as server-sent events.
Expand All @@ -201,23 +202,19 @@ public class PriceResource {
@Inject
@Stream("my-data-stream") Publisher<Double> prices; // <1>
@GET
@Produces(MediaType.TEXT_PLAIN)
public String hello() {
return "hello";
}
@GET
@Path("/stream")
@Produces(MediaType.SERVER_SENT_EVENTS) // <2>
public Publisher<Double> stream() { // <3>
@Produces(MediaType.SERVER_SENT_EVENTS) // <2>
@SseElementType("text/plain") // <3>
public Publisher<Double> stream() { // <4>
return prices;
}
}
----
<1> Injects the `my-data-stream` stream using the `@Stream` qualifier
<2> Indicates that the content is sent using `Server Sent Events`
<3> Returns the stream (_Reactive Stream_)
<3> Indicates that the data contained within the server sent events, is of type `text/plain`
<4> Returns the stream (_Reactive Stream_)

== Configuring the Kafka connector

Expand Down

0 comments on commit a3fdfde

Please sign in to comment.