New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
First draft on Streaming Developer Guide #7
First draft on Streaming Developer Guide #7
Conversation
a497b51
to
d634b47
Compare
Can't pull down the PR because of the .idea/ directory as well as shown here:
|
@cppwfs Removed the |
@ilayaperumalg WOOHOO it works! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just some general thoughts and suggestions.
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/3-data-flow-stream.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/3-programming-models/3-kafka-streams.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/4-continuous-delivery/1-cd-basics.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/1-getting-started/1-simple-stream.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/1-getting-started/1-simple-stream.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/1-getting-started/1-simple-stream.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/0-index.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/2-standalone-stream-kafka.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/2-standalone-stream-kafka.md
Outdated
Show resolved
Hide resolved
content/documentation/3-stream-developer-guides/2-streams/1-standalone-stream-rabbitmq.md
Outdated
Show resolved
Hide resolved
### Application Registration | ||
|
||
Spring Cloud Data Flow server has an application registry to refer all the individual streaming applications. | ||
When you register an application, you would provide |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suffix with a colon
|
||
Let's register the standalone applications we tested previously. | ||
|
||
NOTE: If you are running your Spring Cloud Data Flow server on docker environment, make sure the you have all your application artifact URIs are accessible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
server on docker environment
should be server on the docker environment
|
||
Let's register the standalone applications we tested previously. | ||
|
||
NOTE: If you are running your Spring Cloud Data Flow server on docker environment, make sure the you have all your application artifact URIs are accessible. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make sure the you have all your
should be make sure that your
|
||
Once the stream is deployed on `Local` development environment, you can look the runtime applications via Dashboard's runtime page or using the SCDF Shell command `runtime apps`. | ||
The runtime applications show information about where each application is running in the local environment and their log files locations. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if we need to show the log info here.
But if we do we need show them a screenshot of where to obtain the log file location from runtime apps and then an example bash shell of them catting or tailing the log.
|
||
https://docs.spring.io/spring-cloud-dataflow/docs/current/reference/htmlsingle/#spring-cloud-dataflow-stream-lifecycle-update | ||
The above SCDF shell command registers the `Maven` artifacts of the out of the box streaming applications that can work on `RabbitMQ` messaging middleware. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says rabbitmq, but the examples show kafka.
@@ -6,3 +6,123 @@ summary: true | |||
--- | |||
|
|||
Discuss the set of features that will be covered. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This line is causing the generated page to not render properly. Needs to be moved below the meta-tags.
be03cfd
to
5eca5d2
Compare
@ilayaperumalg we need to remove the .idea files from the PR. The PR is failing to be pulled due to the following error:
|
@cppwfs Sorry, it was my mistake when I pushed the changes without noticing the |
No worries at all! Thanks for fixing!
…Sent from my iPhone
On Apr 26, 2019, at 10:42 PM, Ilayaperumal Gopinathan ***@***.***> wrote:
@cppwfs Sorry, it was my mistake when I pushed the changes without noticing the .idea directory (though I added this into .gitignore). Pushed the changes to remove the .idea directory now.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
- Add Stream Introduction - Spring Cloud Stream & SCDF interactions - Binding properties - Binder properties - Standalone Stream development & testing - On RabbitMQ, Apache Kafka - Create OOTB stream - Creation of custom stream application - Continuous Delivery of streaming applications - Add stream features Resolves #3096 Resolves #3098 Resolves #3172 Resolves #3173
bcf1019
to
67acab8
Compare
|
||
1. Visit the [Spring Initialzr site](https://start.spring.io/). | ||
1. Select the latest release of spring boot. | ||
1. Create a new Maven project with a Group name of `com.example` and an Artifact name of `usage-detail-sender`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instead of com.example
we've been using io.spring
@@ -1,34 +1,110 @@ | |||
--- | |||
path: 'stream-developer-guides/getting-started/simple-stream' | |||
title: 'Simple Stream ' | |||
description: 'Simple Stream ' | |||
title: 'Simple Stream' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file 1-simple-stream file is missing the .md
extension and is not getting rendered on the site.
If you would like to register `docker` artifacts | ||
|
||
``` | ||
dataflow:> app import --uri http://bit.ly/Einstein-SR2-stream-applications-rabbit-docker |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Need to discuss if we want UI images instead or in addition to shell commands @markpollack @sabbyanandan .
### Registering out of the box streaming applications using the Shell | ||
|
||
``` | ||
dataflow:> app import --uri http://bit.ly/Einstein-SR2-stream-applications-kafka-maven |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The app import should use RabbitMQ instead of Kafka, so that it matches the text and example below.
|
||
#### Biz Logic | ||
|
||
1. In your favorite IDE create the `com.example.demo.domain` package |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
demo
should be usagedetailsender
. Based on the initializr instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These changes need to be made globally in this sample.
You can run the standalone `UsageCostLogger` sink application as, | ||
|
||
``` | ||
java -jar usage-cost-logger-0.0.1-SNAPSHOT.jar --spring.cloud.stream.bindings.input.destination=test-usage-cost --server.port=9092 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
app started and then stopped, using the instructions above.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the pom has kafka in it as well....not rabbit. There needs to be another directory level, one for kafka, one for rabbit, stream-developer-guides/streams/standalone-stream-kafka
and stream-developer-guides/streams/standalone-stream-rabbitmq
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you add the code from the biz logic step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The link for UsagecostDetail is also wrong.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes.
package io.spring.dataflow.sample;
import io.spring.dataflow.sample.domain.UsageCostDetail;
import io.spring.dataflow.sample.domain.UsageDetail;
import org.springframework.cloud.stream.annotation.EnableBinding;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.cloud.stream.messaging.Processor;
import org.springframework.messaging.handler.annotation.SendTo;
@EnableBinding(Processor.class)
public class UsageCostProcessor {
private double ratePerSecond = 0.1;
private double ratePerMB = 0.05;
@StreamListener(Processor.INPUT)
@SendTo(Processor.OUTPUT)
public UsageCostDetail processUsageCost(UsageDetail usageDetail) {
UsageCostDetail usageCostDetail = new UsageCostDetail();
usageCostDetail.setUserId(usageDetail.getUserId());
usageCostDetail.setCallCost(usageDetail.getDuration() * this.ratePerSecond);
usageCostDetail.setDataCost(usageDetail.getData() * this.ratePerMB);
return usageCostDetail;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I refactored the code by moving the package in Github but missed to update the link. will fix.
|
||
Another option instead of using the UI to initialize your project you can do the following: | ||
|
||
1. Click the [here](https://start.spring.io/starter.zip?fakeusernameremembered=&fakepasswordremembered=&type=maven-project&language=java&bootVersion=2.1.4.RELEASE&baseDir=usage-detail-sender&groupId=io.spring.dataflow.sample&artifactId=usage-detail-sender&name=usage-detail-sender&description=Sample+project+for+Spring+Cloud+Stream+Source&packageName=io.spring.dataflow.sample&packaging=jar&javaVersion=1.8&inputSearch=&style=amqp&style=cloud-stream) to download the preconfigured usage-detail-sender.zip. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Link needs to be updated using kafka instead of AMQ.
|
||
#### Testing | ||
|
||
We can individually test these custom applications before creating a pipeline using Spring Cloud Data Flow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be updated for Kafka
|
||
1. Visit the [Spring Initialzr site](https://start.spring.io/). | ||
1. Select the latest release of spring boot. | ||
1. Create a new Maven project with a Group name of `com.example` and an Artifact name of `usage-cost-processor`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
com.example needs to be io.spring.dataflow.sample
@@ -0,0 +1,222 @@ | |||
--- | |||
path: 'stream-developer-guides/streams/standalone-stream-kafka/' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Update instructions to be Kafka instead of RabbitMQ.
merged as 7cfa4f2 |
Add Stream Introduction
Standalone Stream development & testing
On RabbitMQ, Apache Kafka
Create OOTB stream
Creation of custom stream application
Continuous Delivery of streaming applications
Add stream features
Resolves spring-cloud/spring-cloud-dataflow#3096
Resolves spring-cloud/spring-cloud-dataflow#3098
Resolves spring-cloud/spring-cloud-dataflow#3172
Resolves spring-cloud/spring-cloud-dataflow#3173