Skip to content

Commit

Permalink
Merge pull request #1 from vgenev/feature/#791-EventFramework
Browse files Browse the repository at this point in the history
Feature/#791 event framework
  • Loading branch information
mdebarros authored Aug 5, 2019
2 parents 99f35e5 + da643c8 commit 672c548
Show file tree
Hide file tree
Showing 26 changed files with 8,072 additions and 2 deletions.
555 changes: 555 additions & 0 deletions .circleci/config.yml

Large diffs are not rendered by default.

10 changes: 8 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ typings/
# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz
# --------------- #
# IntelliJ #
# --------------- #
.idea/
**/*.iml

# Yarn Integrity file
.yarn-integrity
Expand All @@ -59,3 +62,6 @@ typings/

# next.js build output
.next

# VSCode directory
.vscode
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:10.15.3-alpine
USER root

WORKDIR /opt/event-stream-processor

RUN apk --no-cache add git
RUN apk add --no-cache -t build-dependencies make gcc g++ python libtool autoconf automake \
&& cd $(npm root -g)/npm \
&& npm config set unsafe-perm true \
&& npm install -g node-gyp

COPY package.json package-lock.json* /opt/event-stream-processor/

RUN npm install --production && \
npm uninstall -g npm

COPY src /opt/event-stream-processor/src
COPY config /opt/event-stream-processor/config
COPY app.js /opt/event-stream-processor/
# COPY docs /opt/central-event-processor/docs

RUN apk del build-dependencies

EXPOSE 3082
CMD node app.js
10 changes: 10 additions & 0 deletions LICENSE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# LICENSE

Copyright © 2017 Bill & Melinda Gates Foundation

The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0
(the "License") and you may not use these files except in compliance with the [License](http://www.apache.org/licenses/LICENSE-2.0). You may obtain a copy of the License at

[http://www.apache.org/licenses/LICENSE-2.0]()

Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the [License](http://www.apache.org/licenses/LICENSE-2.0).
33 changes: 33 additions & 0 deletions app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*****
License
--------------
Copyright © 2017 Bill & Melinda Gates Foundation
The Mojaloop files are made available by the Bill & Melinda Gates Foundation under the Apache License, Version 2.0 (the "License") and you may not use these files except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, the Mojaloop files are distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Contributors
--------------
This is the official list of the Mojaloop project contributors for this file.
Names of the original copyright holders (individuals or organizations)
should be listed with a '*' in the first column. People who have
contributed from an organization can be listed under the organization
that actually holds the copyright for their contributions (see the
Gates Foundation organization for an example). Those individuals should have
their names indented and be marked with a '-'. Email address can be added
optionally within square brackets <email>.
* Gates Foundation
- Name Surname <[email protected]>
* Valentin Genev <[email protected]>
* Deon Botha <[email protected]>
--------------
******/

'use strict'
const setup = require('./src/setup').setup
const Logger = require('@mojaloop/central-services-shared').Logger

try {
setup()
} catch (err) {
Logger.info(`Notifier throws an error ${err}`)
}
17 changes: 17 additions & 0 deletions config/custom-environment-variables.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"emailSettings": {
"smtpConfig": {
"host": "MAIL_NOTIF_SMTP_HOST",
"port": "MAIL_NOTIF_SMTP_PORT",
"secureConnection": "MAIL_NOTIF_SMTP_SECURE_FLAG",
"tls": {
"ciphers":"MAIL_NOTIF_SMTP_TLS_CIPHERS"
},
"auth": {
"user": "MAIL_NOTIF_SMTP_USER",
"pass": "MAIL_NOTIF_SMTP_PASS"
}
}
},
"PORT": "MAIL_NOTIF_PORT"
}
76 changes: 76 additions & 0 deletions config/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
{
"efk": {
"host": "dev1-fluentd.mojaloop.live",
"port": 24224,
"timeout": 3.0,
"reconnectInterval": 600,
"requireAckResponse": true,
"namespace": "logstash"
},
"apm": {
"serviceName": "event-stream-processor",
"serverUrl": "http://dev1-apm.mojaloop.live:80"
},
"PORT": 3082,
"KAFKA": {
"TOPIC_TEMPLATES": {
"GENERAL_TOPIC_TEMPLATE": {
"TEMPLATE": "topic-{{functionality}}",
"REGEX": "topic-(.*)"
}
},
"PRODUCER": {
"EVENT": {
"config": {
"options": {
"messageCharset": "utf8"
},
"rdkafkaConf": {
"metadata.broker.list": "localhost:9092",
"client.id": "es-prod-event",
"event_cb": true,
"dr_cb": true,
"socket.keepalive.enable": true,
"queue.buffering.max.messages": 10000000
},
"topicConf": {
"request.required.acks": "all"
}
}
}
},
"CONSUMER": {
"EVENT": {
"config": {
"options": {
"mode": 2,
"batchSize": 1,
"recursiveTimeout": 100,
"messageCharset": "utf8",
"messageAsJSON": true,
"sync": true,
"consumeTimeout": 1000
},
"rdkafkaConf": {
"client.id": "cep-event-mediation",
"group.id": "cep-event-mediation-group",
"metadata.broker.list": "localhost:9092",
"socket.blocking.max.ms": 1,
"fetch.wait.max.ms": 1,
"fetch.error.backoff.ms": 1,
"queue.buffering.max.ms": 1,
"broker.version.fallback": "0.10.1.0",
"api.version.request": true,
"enable.auto.commit": false,
"auto.commit.interval.ms": 200,
"socket.keepalive.enable": true,
"socket.max.fails": 1
},
"topicConf": {
"auto.offset.reset": "earliest"
}
}
}
}
}
}
Loading

0 comments on commit 672c548

Please sign in to comment.