generated from creek-service/basic-kafka-streams-demo
-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
15 changed files
with
286 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# Apple | ||
**/.DS_Store | ||
|
||
# Ruby Gem | ||
*.gem | ||
.bundle | ||
Gemfile.lock | ||
**/vendor/bundle | ||
|
||
# Jekyll generated files | ||
.jekyll-cache | ||
.jekyll-metadata | ||
.sass-cache | ||
_asset_bundler_cache | ||
_site |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
source "https://rubygems.org" | ||
|
||
gem "jekyll", "~> 4.3" | ||
gem "creek-jekyll-theme", "~> 1.0" | ||
|
||
# # If you have any plugins, put them here! | ||
group :jekyll_plugins do | ||
gem 'jekyll-include_snippet', "~> 0.2" # https://github.com/tomdalling/jekyll-include_snippet | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Repos GitHub pages site. | ||
|
||
## Setup | ||
|
||
If you want to hack about with the site or add content, then follow these instructions to be able to run locally. | ||
|
||
### Prerequisites | ||
|
||
1. Install Git, obviously. | ||
2. [Install Jekyll](https://jekyllrb.com/docs/installation) | ||
3. Install [Builder](https://bundler.io/) by running `gem install bundler`. | ||
|
||
### Installing | ||
|
||
#### 1. Install the gems | ||
|
||
```shell | ||
(cd docs && bundle install) | ||
``` | ||
|
||
#### 2. Update | ||
|
||
Occasionally update gems | ||
|
||
```shell | ||
git checkout main | ||
git pull | ||
(cd docs && bundle update) | ||
git checkout -b gems-update | ||
git add . | ||
git commit -m "updating gems" | ||
git push --set-upstream origin gems-update | ||
``` | ||
|
||
#### 3. Run the local server | ||
|
||
```shell | ||
(cd docs && bundle exec jekyll serve --livereload --baseurl /connected-services-demo) | ||
``` | ||
|
||
This will launch a web server so that you can work on the site locally. | ||
Check it out on [http://localhost:4000/connected-services-demo](http://localhost:4000/connected-services-demo). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Develop override settings | ||
|
||
url: http://localhost:4000 | ||
|
||
analytics: | ||
provider: false | ||
|
||
comments: | ||
disqus: | ||
shortname : "creek-service-dev" | ||
|
||
sass: | ||
style: expanded |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
|
||
# Welcome to Jekyll! | ||
# | ||
# This config file is meant for settings that affect your entire site, values | ||
# which you are expected to set up once and rarely need to edit after that. | ||
# For technical reasons, this file is *NOT* reloaded automatically when you use | ||
# `jekyll serve`. If you change this file, please restart the server process. | ||
|
||
# Site Settings | ||
theme : "creek-jekyll-theme" | ||
baseurl : "/connected-services-demo" | ||
repository: "creek-service/connected-services-demo" | ||
|
||
# Reading Files | ||
include: | ||
- .htaccess | ||
- _pages | ||
exclude: | ||
- README.md | ||
|
||
# Collections | ||
collections: | ||
demo: | ||
output: true | ||
permalink: /:collection/:path | ||
|
||
# Defaults | ||
defaults: | ||
# _pages | ||
- scope: | ||
path: "_pages" | ||
type: pages | ||
values: | ||
layout: single | ||
author_profile: false | ||
toc: true | ||
toc_sticky: true | ||
# _demo | ||
- scope: | ||
path: "" | ||
type: demo | ||
values: | ||
layout: single | ||
read_time: false | ||
author_profile: false | ||
share: false | ||
comments: false | ||
sidebar: | ||
nav: demo | ||
toc: false | ||
toc_sticky: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
- title: "Getting Started" | ||
children: | ||
- title: "Introduction" | ||
url: / | ||
- title: "Bootstrap a new repository" | ||
url: /bootstrap | ||
- title: "Add a second microservice" | ||
url: /add-service | ||
#- title: "Write the code" | ||
# children: | ||
# - title: "Service descriptor" | ||
# url: /descriptor | ||
# - title: "Business logic" | ||
# url: /business-logic | ||
#- title: Testing | ||
# children: | ||
# - title: "System tests" | ||
# url: /system-testing | ||
# - title: "Code coverage" | ||
# url: /system-testing-coverage | ||
# - title: "Unit tests" | ||
# url: /unit-testing | ||
# - title: "Debugging" | ||
# url: /debugging | ||
#- title: Next steps | ||
# children: | ||
# - title: "Deployment" | ||
# url: /deployment | ||
# - title: "Further reading" | ||
# url: /further-reading |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
title: Connected Services Demo | ||
permalink: / | ||
layout: single | ||
toc: true | ||
--- | ||
|
||
This tutorial will lead you through extending the [Basic Kafka Streams demo](/basic-kafka-streams-demo) with a second | ||
microservice, which will consume the output Kafka topic of `handle-occurrence-service` service written in the previous | ||
demo. This topic contains occurrences of Twitter handles, e.g. `@elonmusk`, in tweets and the new service will use this | ||
to build a leaderboard of the most mentioned Twitter handles. | ||
|
||
**Note:** This is a deliberately simplistic service, allowing the tutorial to focus on demonstrating Creek's features. | ||
{: .notice--warning} | ||
|
||
## Features covered | ||
|
||
By the end of this tutorial you should know: | ||
todo | ||
|
||
## Prerequisites | ||
|
||
The tutorial requires the following: | ||
|
||
* A [GitHub](https://github.com/join) account. | ||
* [Git](https://git-scm.com/book/en/v2/Getting-Started-Installing-Git) installed for source code control. | ||
* [Docker desktop](https://docs.docker.com/desktop/) installed for running containerised system tests. | ||
* (Optional) [IntelliJ IDE](https://www.jetbrains.com/help/idea/installation-guide.html) installed for code development. | ||
|
||
## Design | ||
|
||
todo | ||
|
||
## Complete solution | ||
|
||
The completed tutorial can be viewed [on GitHub][demoOnGh]. | ||
|
||
[<i class="fab fa-fw fa-github"/> View on GitHub][demoOnGh]{: .btn .btn--success} | ||
|
||
[demoOnGh]: https://github.com/creek-service/connected-services-demo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
--- | ||
title: Bootstrap a new aggregate | ||
permalink: /bootstrap | ||
description: Create a copy of the first demo, if needed, on which to work | ||
layout: single | ||
--- | ||
|
||
This tutorial builds on the [Basic Kafka Streams demo](/basic-kafka-streams-demo). | ||
If you have completed the previous demo you can use that repository for working through this tutorial: | ||
skip to the [nex step]({{ "/add-service" | relative_url }}). | ||
Otherwise, follow the steps below to create your own copy of the completed tutorial: | ||
|
||
## Create your own copy of the previous demo | ||
|
||
1. Navigate to the [Basic Kafka Streams demo][tempOnGH]{:target="_blank"} on GitHub. | ||
2. Click [<i class="fab fa-fw fa-github"/> Use this template][tempNew]{: .btn .btn--success}{:target="_blank"} to create a new repository, | ||
and fill in the details: | ||
{% include figure image_path="/assets/images/creek-create-new-aggregate.png" alt="Create new aggregate repo" %} | ||
|
||
3. When GitHub creates the new repo, a [boostrap workflow][bootstrapWorkflow] will run to customise the new repository. | ||
Wait for this workflow to complete in the _Actions_ tab: | ||
{% include figure image_path="/assets/images/creek-repo-bootstrap.png" alt="Wait for boostrap workflow" %} | ||
|
||
4. [Clone the new repository][cloneRepo] locally. | ||
5. Finish the initialisation of the repository by running the `clean_up.sh` script from the root of the repository. | ||
|
||
``` | ||
./.creek/clean_up.sh | ||
``` | ||
|
||
The clean-up script will finish off the customisation of the new repository, removing now redundant workflows, | ||
scripts and code. | ||
|
||
6. Commit the changes back to the GitHub | ||
``` | ||
git add -A | ||
git commit -m "clean_up script" | ||
git push | ||
``` | ||
|
||
The repository is now ready for the second service to be added, which will be covered in the next step. | ||
|
||
[tempOnGH]: https://github.com/creek-service/basic-kafka-streams-demo | ||
[tempNew]: https://github.com/creek-service/basic-kafka-streams-demo/generate | ||
[bootstrapWorkflow]: https://github.com/creek-service/basic-kafka-streams-demo/blob/main/.github/workflows/bootstrap.yml | ||
[cloneRepo]: https://docs.github.com/en/repositories/creating-and-managing-repositories/cloning-a-repository |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
--- | ||
title: Adding a second microservice | ||
permalink: /add-service | ||
description: Learn how to use the Creek aggregate template to quickly add a second microservices. | ||
layout: single | ||
--- | ||
|
||
We'll use the same process as in previous demos to add a new service to our existing aggregate repository: | ||
|
||
1. Go to the `Actions` tab of the new repository on GitHub. | ||
2. Select `Add service module` from the list of available workflows on the left. | ||
{% include figure image_path="/assets/images/creek-add-service-workflow.png" alt="Add new service module workflow" %} | ||
3. Click the `Run workflow ▾` button and enter the service name as `handle-scoreboard-service`: | ||
{% include figure image_path="/assets/images/creek-add-service.png" alt="Add new service" %} | ||
|
||
**Note:** Service names must be lowercase. Only alphanumerics and dashes are supported. | ||
{: .notice--warning} | ||
|
||
**ProTip:** End your service names with `-service` to make it clear the module contains a microservice. | ||
{: .notice--info} | ||
4. Click the [Run workflow](){: .btn .btn--small .btn--disabled .btn--success} button below the service name. | ||
|
||
This will kick off a workflow that adds the new module, containing the boilerplate code for a new service, | ||
though you may need to refresh the web page to view it. | ||
|
||
{% include figure image_path="/assets/images/creek-add-service-workflow-running.png" alt="Running workflow" %} | ||
|
||
Wait for the workflow to complete and pull down the changes to your local machine by running: | ||
|
||
```shell | ||
git pull | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
--- | ||
title: "Page Not Found" | ||
excerpt: "Page not found. Your pixels are in another canvas." | ||
sitemap: false | ||
permalink: /404.html | ||
--- | ||
|
||
Sorry, but the page you were trying to view does not exist. :confused: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.