Giter Site home page Giter Site logo

hemerajs / aither Goto Github PK

View Code? Open in Web Editor NEW
120.0 120.0 26.0 6.15 MB

An example microservice system in Node.js using Hemera and best of today.

License: GNU General Public License v3.0

JavaScript 77.83% Shell 22.17%
hapi hemera jaegertracing microservices-architecture nats traefik

aither's People

Contributors

starptech avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aither's Issues

Errors when starting Aither

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

"Could not connect to NATS!"

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!

Joi validation not working?

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?

Development workflow

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.