Skip to content

Commit

Permalink
feat(csi-334): updated proxyCache to use redis cluster (#536)
Browse files Browse the repository at this point in the history
* feat(csi-334): updated proxyCache to use redis cluster

* feat(csi-334): updated proxyCache to use redis cluster

* feat(csi-334): updated proxyCache to use redis cluster

* feat(csi-334): updated proxyCache to use redis cluster

* chore(snapshot): 14.1.0-snapshot.0

* chore(snapshot): 14.1.0-snapshot.1

* chore(snapshot): 14.1.0-snapshot.2

* chore(snapshot): 14.1.0-snapshot.3

* chore(snapshot): 14.1.0-snapshot.4

* chore(snapshot): 14.1.0-snapshot.5

* chore(snapshot): 14.1.0-snapshot.6

* chore(snapshot): 14.1.0-snapshot.7

* chore(snapshot): 14.1.0-snapshot.8

* chore(snapshot): 14.1.0-snapshot.9

* chore(snapshot): 14.1.0-snapshot.10

* chore(snapshot): 14.1.0-snapshot.11

* chore(snapshot): 14.1.0-snapshot.12

* chore(snapshot): 14.1.0-snapshot.13

* chore(snapshot): 14.1.0-snapshot.14

* chore(snapshot): 14.1.0-snapshot.15

* chore(snapshot): 14.1.0-snapshot.16

* chore(snapshot): 14.1.0-snapshot.17
  • Loading branch information
geka-evk authored Jul 26, 2024
1 parent f31acb1 commit 863bbaf
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 60 deletions.
39 changes: 30 additions & 9 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,14 @@ networks:
ml-mojaloop-net:
name: ml-mojaloop-net

x-redis-node: &REDIS_NODE
image: docker.io/bitnami/redis-cluster:6.2.14
environment: &REDIS_ENVS
ALLOW_EMPTY_PASSWORD: yes
REDIS_NODES: redis-node-0 redis-node-1 redis-node-2 redis-node-3 redis-node-4 redis-node-5
networks:
- ml-mojaloop-net

services:
ml-api-adapter:
image: mojaloop/ml-api-adapter:local
Expand Down Expand Up @@ -175,15 +183,28 @@ services:
timeout: 20s
retries: 10
interval: 30s
redis:
image: redis:7.2.5
container_name: redis
networks:
- ml-mojaloop-net

redis-node-0:
<<: *REDIS_NODE
environment:
- ALLOW_EMPTY_PASSWORD=yes
- REDIS_PORT=6379
- REDIS_REPLICATION_MODE=master
- REDIS_TLS_ENABLED=no
<<: *REDIS_ENVS
REDIS_CLUSTER_CREATOR: yes
depends_on:
- redis-node-1
- redis-node-2
- redis-node-3
- redis-node-4
- redis-node-5
ports:
- "6379:6379"

redis-node-1:
<<: *REDIS_NODE
redis-node-2:
<<: *REDIS_NODE
redis-node-3:
<<: *REDIS_NODE
redis-node-4:
<<: *REDIS_NODE
redis-node-5:
<<: *REDIS_NODE
5 changes: 3 additions & 2 deletions docker/ml-api-adapter/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
"enabled": true,
"type": "redis",
"proxyConfig": {
"host": "redis",
"port": 6379
"cluster": [
{ "host": "redis-node-0", "port": 6379 }
]
}
},
"HUB_PARTICIPANT": {
Expand Down
138 changes: 106 additions & 32 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mojaloop/ml-api-adapter",
"version": "14.1.0-proxy.16",
"version": "14.1.0-snapshot.17",
"description": "Convert from ML API to/from internal Central Services messaging format",
"license": "Apache-2.0",
"private": true,
Expand Down Expand Up @@ -89,9 +89,9 @@
"@hapi/vision": "7.0.3",
"@mojaloop/central-services-error-handling": "13.0.1",
"@mojaloop/central-services-health": "15.0.0",
"@mojaloop/central-services-logger": "11.3.1",
"@mojaloop/central-services-logger": "11.5.0",
"@mojaloop/central-services-metrics": "12.0.8",
"@mojaloop/central-services-shared": "18.6.3",
"@mojaloop/central-services-shared": "18.7.0-snapshot.0",
"@mojaloop/central-services-stream": "11.3.1",
"@mojaloop/event-sdk": "14.1.1",
"@mojaloop/sdk-standard-components": "18.3.0",
Expand All @@ -110,7 +110,7 @@
},
"devDependencies": {
"@mojaloop/database-lib": "11.0.6",
"@mojaloop/inter-scheme-proxy-cache-lib": "^1.4.0",
"@mojaloop/inter-scheme-proxy-cache-lib": "2.0.0-snapshot.1",
"@types/hapi__joi": "^17.1.14",
"audit-ci": "^7.1.0",
"get-port": "5.1.1",
Expand Down
4 changes: 2 additions & 2 deletions scripts/_wait4_all.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const expectedContainers = [
'ml_mysql'
]

let retries = 40
const waitTimeMs = 60000
let retries = 50
const waitTimeMs = 20000

async function main () {
const waitingMap = {}
Expand Down
12 changes: 11 additions & 1 deletion test/fixtures/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,15 @@ const createMessageProtocol = (eventType = 'prepare', eventAction = 'prepare', p
}
}

const proxyCacheConfigDto = ({ host = 'localhost' } = {}) => ({
type: 'redis',
proxyConfig: {
cluster: [
{ host, port: 6379 }
]
}
})

module.exports = {
buildTransfer,
buildFXTransfer,
Expand All @@ -179,5 +188,6 @@ module.exports = {
generateTransferId,
generateParentTestSpan,
createMessageProtocol,
createProducerConfig
createProducerConfig,
proxyCacheConfigDto
}
Loading

0 comments on commit 863bbaf

Please sign in to comment.