Skip to content

Commit

Permalink
Merge pull request #4 from vgenev/feature/#969-dep-update
Browse files Browse the repository at this point in the history
Feature/#969 dep update
  • Loading branch information
vgenev authored Sep 19, 2019
2 parents 38769c5 + 3de3fe3 commit 6e961a6
Show file tree
Hide file tree
Showing 24 changed files with 1,479 additions and 1,220 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8

[*.js]
indent_style = space
indent_size = 2

[{package.json,*.yml,*.cjson}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
coverage
templates
docs
**/node_modules
29 changes: 29 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"parserOptions": {
"ecmaVersion": 9
},
"rules": {
"no-console": ["off"],
"indent": [
2,
2
],
"quotes": [
2,
"single"
],
"linebreak-style": [
2,
"unix"
],
"semi": [
2,
"never"
]
},
"env": {
"es6": true,
"node": true
},
"extends": "eslint:recommended"
}
24 changes: 24 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,26 @@
# event-stream-processor
** EXPERIMENTAL** Event Stream Processor for Event Stream (logs, audits, errors, trace, etc)

## 1. Pre-requisites

### 1.1 Elasticsearch

Ensure that you have created the `mojatemplate` based on the following config: [template](./config/template-mojaloop.json).

#### 1.1.1 Create Template
```curl
curl -X PUT "http://elasticsearch:9200/_template/mojatemplate?pretty" -H 'Content-Type: application/json' -d @config/template-mojaloop.json'
```

#### 1.1.2 Delete Template
_Note: only needed if you need to remove the template_
```curl
curl -X DELETE "http://elasticsearch:9200/_template/mojatemplate"
```

#### 1.1.3 Get Template
_Note: useful for debugging template issues_
```curl
curl -X GET "http://elasticsearch:9200/_template/mojatemplate"
```

2 changes: 1 addition & 1 deletion app.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

try {
setup()
Expand Down
17 changes: 0 additions & 17 deletions config/custom-environment-variables.json

This file was deleted.

27 changes: 14 additions & 13 deletions config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,18 @@
"requireAckResponse": true,
"namespace": "logstash"
},
"apm": {
"EFK_CLIENT": {
"host": "dev1-elasticsearch.mojaloop.live",
"log": "trace",
"index": {
"name": "mojaloop",
"template": "{{index}}-{{date}}"
}
},
"APM": {
"serviceName": "event-stream-processor",
"serverUrl": "http://dev1-apm.mojaloop.live:80"
"serverUrl": "http://dev1-apm.mojaloop.live:80",
"captureErrorLogStackTraces": "never"
},
"PORT": 3082,
"KAFKA": {
Expand Down Expand Up @@ -45,6 +54,7 @@
"options": {
"mode": 2,
"batchSize": 1,
"pollFrequency": 10,
"recursiveTimeout": 100,
"messageCharset": "utf8",
"messageAsJSON": true,
Expand All @@ -55,16 +65,7 @@
"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
"socket.keepalive.enable": true
},
"topicConf": {
"auto.offset.reset": "earliest"
Expand All @@ -73,4 +74,4 @@
}
}
}
}
}
211 changes: 211 additions & 0 deletions config/template-mojaloop.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
{
"index_patterns": ["mojaloop*"],
"settings": {
"number_of_shards": 1,
"number_of_replicas": 1
},
"mappings": {
"_source": {
"enabled": true
},
"properties": {
"content": {
"type": "flattened"
},
"from": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"metadata": {
"properties": {
"event": {
"properties": {
"action": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"createdAt": {
"type": "date"
},
"id": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"responseTo": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"state": {
"properties": {
"code": {
"type": "long"
},
"description": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"status": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"trace": {
"properties": {
"finishTimestamp": {
"type": "date"
},
"parentSpanId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"service": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"spanId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"startTimestamp": {
"type": "date"
},
"tags": {
"properties": {
"parentEventAction": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"parentEventType": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"transctionId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"transctionType": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
},
"traceId": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
},
"to": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
},
"type": {
"type": "text",
"fields": {
"keyword": {
"type": "keyword",
"ignore_above": 256
}
}
}
}
}
}
Loading

0 comments on commit 6e961a6

Please sign in to comment.