hemerajs / aither Goto Github PK
View Code? Open in Web Editor NEWAn example microservice system in Node.js using Hemera and best of today.
License: GNU General Public License v3.0
An example microservice system in Node.js using Hemera and best of today.
License: GNU General Public License v3.0
I've just run this example, but the validation described in the Hemera documentation as used here, doesn't appear to have the desired effect.
Input
Requested URL:
http://localhost:8182/api/add?a=2&b=52ca
Expected Result
Some form of error given back to the actor where err instanceOf PayloadValidationError
Actual Result
math-service/index.js:35
let operation = (a, b) => { return a + b }
This routine is still executed, where typeof a === 'string', so the values are concatenated.
Is there a bug / change in the Joi validator breaking this example?
I'm getting this message looping while the services are running.
cache-service_1 | [2017-09-19T09:09:31.776Z] INFO (hemera-9c62d65821b7-ca4d19e8803e41368b57f8d0c7723ffe/1 on 9c62d65821b7): hemera-joi PLUGIN - ADDED!
cache-service_1 | [2017-09-19T09:09:31.782Z] INFO (hemera-9c62d65821b7-ca4d19e8803e41368b57f8d0c7723ffe/1 on 9c62d65821b7): hemera-redis-cache PLUGIN - ADDED!
cache-service_1 | [2017-09-19T09:09:31.836Z] ERROR (NatsError/1 on 9c62d65821b7): Could not connect to NATS!
cache-service_1 | Error
cache-service_1 | at Socket.<anonymous> (/usr/src/app/node_modules/nats/lib/nats.js:454:28)
cache-service_1 | at emitOne (events.js:96:13)
cache-service_1 | at Socket.emit (events.js:188:7)
cache-service_1 | at connectErrorNT (net.js:1025:8)
cache-service_1 | at _combinedTickCallback (internal/process/next_tick.js:74:11)
cache-service_1 | at process._tickCallback (internal/process/next_tick.js:98:9)
cache-service_1 | [2017-09-19T09:09:31.839Z] ERROR (hemera-9c62d65821b7-ca4d19e8803e41368b57f8d0c7723ffe/1 on 9c62d65821b7): NATS Code: 'CONN_ERR', Message: Could not connect to server: Error: getaddrinfo ENOTFOUND nats nats:4222
cache-service_1 | [2017-09-19T09:09:31.847Z] WARN (hemera-9c62d65821b7-ca4d19e8803e41368b57f8d0c7723ffe/1 on 9c62d65821b7): NATS disconnected!
Hey, this is great and worked perfectly, with everything thats required, but we are having a few challenges trying to figure out what a comfortable development workflow would be like, is it volumes with docker or coding outside the system with tests or
:-) please advice
I followed all the steps that were passed, but when I boot with docker-compose up
in the console it already shows some errors, for example:
math-service_1 | TypeError: Cannot read property 'joi' of undefined
math-service_1 | at Hemera.hemera.ready (/usr/src/app/index.js:26:44)
math-service_1 | at Client.<anonymous> (/usr/src/app/node_modules/nats-hemera/build/index.js:411:14)
math-service_1 | at emitOne (events.js:96:13)
math-service_1 | at Client.emit (events.js:188:7)
math-service_1 | at Client.connectCB (/usr/src/app/node_modules/nats/lib/nats.js:393:8)
math-service_1 | at /usr/src/app/node_modules/nats/lib/nats.js:821:45
math-service_1 | at Client.processInbound (/usr/src/app/node_modules/nats/lib/nats.js:791:19)
math-service_1 | at Socket.<anonymous> (/usr/src/app/node_modules/nats/lib/nats.js:468:12)
math-service_1 | at emitOne (events.js:96:13)
math-service_1 | at Socket.emit (events.js:188:7)
math-service_1 | /usr/src/app/index.js:26
math-service_1 | let Joi = hemera.exposition['hemera-joi'].joi
Until then it starts the other services normally, but when I do the request: http://localhost:8182/api/add?a=1&b=10
it returns the following error:
api_1 | { TimeoutError
api_1 | at timeoutHandler (/usr/src/app/node_modules/nats-hemera/build/index.js:981:21)
api_1 | at Timeout._onTimeout (/usr/src/app/node_modules/nats/lib/nats.js:1175:41)
api_1 | at ontimeout (timers.js:365:14)
api_1 | at tryOnTimeout (timers.js:237:5)
api_1 | at Timer.listOnTimeout (timers.js:207:5)
api_1 | message: 'Timeout',
api_1 | pattern: { topic: 'math', cmd: 'add', a: '1', b: '10', refresh: false } }
traefik_1 | time="2017-03-05T03:13:34Z" level=warning msg="Error forwarding to http://172.19.0.9:8789, err: EOF"
traefik_1 | time="2017-03-05T03:13:34Z" level=debug msg="Docker event received {Status:die ID:1864792805f62854cb7429ff966faf51a99b8524c8a48e17b69c60df8e641632 From:aither_api Type:container Action:die Actor:{ID:1864792805f62854cb7429ff966faf51a99b8524c8a48e17b69c60df8e641632 Attributes:map[com.docker.compose.oneoff:False com.docker.compose.version:1.8.1 image:aither_api traefik.backend:api traefik.frontend.rule:PathPrefix: /api com.docker.compose.config-hash:ca6358ba5b4efa6e09c0865e5b5e60847559d127c84bce2ed1e126a12b9faae3 com.docker.compose.container-number:1 exitCode:1 name:aither_api_1 traefik.frontend.entryPoints:http traefik.port:8789 com.docker.compose.project:aither com.docker.compose.service:api]} Time:1488683614 TimeNano:1488683614237169189}"
I got to test in 3 different environments and the same problem appeared
Is possible to implement a Hemera microservice inside an AWS Lambda?
Update Hemera to 3, Use Jaeger instead Zipkin, Use Hapi 17
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.