Skip to content
This repository was archived by the owner on Aug 25, 2022. It is now read-only.

Commit d2071c9

Browse files
authored
Merge pull request #17 from hellofresh/feature/prepare-to-opensource
Open source kandalf
2 parents 741fd22 + a9f533a commit d2071c9

File tree

8 files changed

+146
-5
lines changed

8 files changed

+146
-5
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# How to reproduce
2+
-
3+
4+
# Expected behaviour
5+
-
6+
7+
# Actual behaviour
8+
-

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
**Before submitting PR, please check that you launched `make fmt` to format code according code style guide**
2+
3+
# What this PR changes:
4+
-
5+
6+
# When reviewing, please consider:
7+
-

CONTRIBUTING.md

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
# Request for contributions
2+
3+
Please contribute to this repository if any of the following is true:
4+
- You have expertise in community development, communication, or education
5+
- You want open source communities to be more collaborative and inclusive
6+
- You want to help lower the burden to first time contributors
7+
8+
# How to contribute
9+
10+
Prerequisites:
11+
12+
- familiarity with [GitHub PRs](https://help.github.com/articles/using-pull-requests) (pull requests) and issues
13+
- knowledge of Markdown for editing `.md` documents
14+
15+
In particular, this community seeks the following types of contributions:
16+
17+
- ideas: participate in an Issues thread or start your own to have your voice
18+
heard
19+
- resources: submit a PR to add to [docs README.md](README.md) with links to related content
20+
- outline sections: help us ensure that this repository is comprehensive. if
21+
there is a topic that is overlooked, please add it, even if it is just a stub
22+
in the form of a header and single sentence. Initially, most things fall into
23+
this category
24+
- write: contribute your expertise in an area by helping us expand the included
25+
content
26+
- copy editing: fix typos, clarify language, and generally improve the quality
27+
of the content
28+
- formatting: help keep content easy to read with consistent formatting
29+
- code: Fix issues or contribute new features to this or any related projects
30+
31+
# Conduct
32+
33+
We are committed to providing a friendly, safe and welcoming environment for
34+
all, regardless of gender, sexual orientation, disability, ethnicity, religion,
35+
or similar personal characteristic.
36+
37+
Please be kind and courteous. There's no need to be mean or rude.
38+
Respect that people have differences of opinion and that every design or
39+
implementation choice carries a trade-off and numerous costs. There is seldom
40+
a right answer, merely an optimal answer given a set of values and
41+
circumstances.
42+
43+
Please keep unstructured critique to a minimum. If you have solid ideas you
44+
want to experiment with, make a fork and see how it works.
45+
46+
We will exclude you from interaction if you insult, demean or harass anyone.
47+
That is not welcome behavior. We interpret the term "harassment" as
48+
including the definition in the
49+
[Citizen Code of Conduct](http://citizencodeofconduct.org/);
50+
if you have any lack of clarity about what might be included in that concept,
51+
please read their definition. In particular, we don't tolerate behavior that
52+
excludes people in socially marginalized groups.
53+
54+
Private harassment is also unacceptable. No matter who you are, if you feel
55+
you have been or are being harassed or made uncomfortable by a community
56+
member, please contact one of the
57+
[hellofresh](https://github.com/orgs/hellofresh/people) core team
58+
immediately. Whether you're a regular contributor or a newcomer, we care about
59+
making this community a safe place for you and we've got your back.
60+
61+
Likewise any spamming, trolling, flaming, baiting or other attention-stealing
62+
behavior is not welcome.
63+
64+
# Communication
65+
66+
GitHub issues are the primary way for communicating about specific proposed
67+
changes to this project.
68+
69+
In both contexts, please follow the conduct guidelines above. Language issues
70+
are often contentious and we'd like to keep discussion brief, civil and focused
71+
on what we're actually doing, not wandering off into too much imaginary stuff.

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 HelloFresh
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<p align="center">
2+
<a href="https://hellofresh.com">
3+
<img width="120" src="https://www.hellofresh.de/images/hellofresh/press/HelloFresh_Logo.png">
4+
</a>
5+
</p>
6+
17
# kandalf also known as "RabbitMQ to Kafka bridge"
28

39
The main idea is to read messages from provided exchanges in [RabbitMQ](https://www.rabbitmq.com/) and send them to [Kafka](http://kafka.apache.org/).
@@ -6,7 +12,7 @@ The main idea is to read messages from provided exchanges in [RabbitMQ](https://
612

713
This service is written in Go language and can be build with go compiler of version 1.6 and above.
814

9-
The rules, defining which messages should be send to which Kafka topics, are defined in "[pipes.yml](./build/resources/pipes.yml)" and is called "pipes".
15+
The rules, defining which messages should be send to which Kafka topics, are defined in "[pipes.yml](./ci/resources/pipes.yml)" and is called "pipes".
1016

1117
Each pipe should contain following keys.
1218
* **kafka_topic** _str_ — name of the topic in kafka where message will be sent;
@@ -19,7 +25,7 @@ Each pipe should contain following keys.
1925
1. Make sure that you have `make` utility installed on your machine;
2026
2. Run: `make bootstrap` to install [glide](https://glide.sh) and dependencies;
2127
3. Run: `make` to build binary;
22-
4. Binaries for Linux and MacOS X would be in `_build/out/`.
28+
4. Binaries for Linux and MacOS X would be in `./out/`.
2329

2430
## Hot to build deb-package
2531

@@ -36,7 +42,14 @@ Each pipe should contain following keys.
3642
4. Run: `make`
3743
5. Run: `make docker-run`
3844

45+
## How to contribute
46+
47+
Just follow instructions placed in [CONTRIBUTING.md](./CONTRIBUTING.md).
48+
3949
## Todo
4050

4151
* [x] Handle dependencies in a proper way (gvt, glide or smth.)
4252
* [ ] Tests
53+
54+
--------
55+
HelloFresh - More Than Food.

ci/pipeline.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,29 @@ jobs:
5050
- get: app-pr
5151
trigger: true
5252

53+
- put: app-pr
54+
params:
55+
path: app-pr
56+
context: test
57+
status: pending
58+
5359
- task: Check for unchecked errors and suspicious constructs
5460
file: app-pr/ci/tasks/app-pr-check-errors.yml
5561
params:
5662
PROJECT_SRC: {{project_src}}
5763
RESOURCE: app-pr
64+
on_success:
65+
put: app-pr
66+
params:
67+
path: app-pr
68+
context: test
69+
status: success
70+
on_failure:
71+
put: app-pr
72+
params:
73+
path: app-pr
74+
context: test
75+
status: failure
5876

5977
- name: Check master branch for errors
6078
plan:

ci/resources/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ queue:
4343
flush_timeout: "10s"
4444
rabbitmq:
4545
url: "amqp://user:password@rmq"
46+
# kandalf can send certain metrics to statsd, leave address empty if you don't need it
4647
statsd:
4748
address: ""
4849
prefix: "kandalf"

ci/resources/pipes.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
---
2-
- kafka_topic: "new-orders"
3-
rabbitmq_exchange_name: "customers"
4-
rabbitmq_routing_key: "order.created"
2+
- rabbitmq_exchange_name: "customers" # Message from that RabbitMQ exchange
3+
rabbitmq_routing_key: "order.created" # With that routing key
4+
kafka_topic: "new-orders" # Will be placed to that kafka topic
5+
# The queue name can be whatever you want, just keep it unique within pipes.
6+
# If you launch multiple kandalf instances they all will consume messages from that queue.
57
rabbitmq_queue_name: "kandalf-customers-order.created"
68

79
- kafka_topic: "loyalty"

0 commit comments

Comments
 (0)