node.js - How to configure Hystrixjs in a node app? -
i trying configure hystrixjs 1 of nodejs app. want wrap couple of external dependencies app making. https://www.npmjs.com/package/hystrixjs
i read readme still couldn't how can wrap dependency call hystrix , how configure dashboard this. if tried before please give me directions.
thanks.
you can find sample in example app in repo. feel free submit question on bitbucket , try provide more examples.
in general can wrap function returns promise, not have http request, although common use case.
the dashboard not part of hystrix itself. way works, can run dashboard locally, see instructions here , add endpoint application expose metrics. example app shows how it:
function hystrixstreamresponse(request, response) { response.append('content-type', 'text/event-stream;charset=utf-8'); response.append('cache-control', 'no-cache, no-store, max-age=0, must-revalidate'); response.append('pragma', 'no-cache'); return hystrixstream.toobservable().subscribe( function onnext(ssedata) { response.write('data: ' + ssedata + '\n\n'); }, function onerror(error) {console.log(error); }, function oncomplete() { return response.end(); } ); }; app.get('/api/hystrix.stream', hystrixstreamresponse); you can paste url dashboard , display commands.
let me know if helps
Comments
Post a Comment