microservices

Consul: SD architecture. What is the right way to access microservices from a front-end side?

旧时模样 提交于 2019-12-24 07:56:31
问题 I have a few back-end microservices managed by consul, and to get some data from one service for the other one, I use service discovery feature of consul - like get all healthy servers, then get server address and port from the retrieved entry etc. But how should I do it from a front-end side? Just call needed microserver using it's actual ip or call it using namespace of docker container? It will be very helpful to get any response from someone who knows how to do it or even better, who did

IP Control for backup services and connection with Registery Service

↘锁芯ラ 提交于 2019-12-24 07:53:25
问题 let's take Eureka. in a normal scenario, A microservice is registered with the Eureka, and we get its information there. the microservice has multiple backup servers. the question is, how these servers will be registered in Eureka. Will all the Backup servers have different IP or same IP! how the registration for backup servers happen, and how the backup server is chosen. 来源: https://stackoverflow.com/questions/52436548/ip-control-for-backup-services-and-connection-with-registery-service

how to make a non-hardcoded URL path in docker image to call backend service?

喜夏-厌秋 提交于 2019-12-24 06:40:50
问题 I'm new in docker. Let me describe my scenario: I made 2 docker images for a web application. one image is front-end web layer for presentation and the other is back-end layer supplying REST service. So I need to run 2 containers for this 2 images. the front-end calls services in back-end. Now I need to write the back-end's URL in front-end's code and build the image...I don't think this is the right way for micro service... because if my laptop's IP changes or others want to use my image

how to use nestjs redis microservice?

牧云@^-^@ 提交于 2019-12-24 06:01:04
问题 I am learning nestjs microservice, What command can I use? const pattern = { cmd: 'get' }; this.client.send<any>(pattern, data) And how can I receive data from redis? constructor(private readonly appService: AppService) {} @Client({ transport: Transport.REDIS, options: { url: 'redis://127.0.0.1:6379', }, }) client: ClientProxy; @Get() getHello(): any { const pattern = { cmd: 'get foo' }; //Please write sample code here in document const data = ''; return this.client.send<any>(pattern, data);

Passing param to ngOnInit through service

故事扮演 提交于 2019-12-24 03:44:29
问题 I just started learning about angular 2 and I am having questions on if the scenario I think is possible. I have a micro service model where in I have angular apps associated to each micro service. Microservice 1 & ng app 1 - is for handling the transactions of the user service 2 and ng app 2 - is to calculate all applicable taxes for the user If I land on app 1, enter the details of my transaction and click a continue button, I should be able to pass "All" the values that are required for

Nodejs not able to connect to mongodb on cloud shell

血红的双手。 提交于 2019-12-24 01:37:05
问题 My MongoDB server is hosted on google-cloud VM. I wish to create App Engine microservice. to test connectivity, my server.js looks like const MongoClient = require('mongodb').MongoClient; const test = require('assert'); // Connection url const url = 'mongodb://testmongodb:27017'; // Database Name const dbName = 'test'; // Connect using MongoClient MongoClient.connect(url, { useNewUrlParser: true },function(err, client) { if(err){console.log(err)} else {console.log("Connected successfully")} }

Recovering state consistency in Flink when using Kafka as EventStore

夙愿已清 提交于 2019-12-24 00:43:28
问题 The problem I am implementing a microservice as an event-sourcing aggregate which, in turn, is implemented as a Flink FlatMapFunction. In the basic setup, the aggregate reads events and commands from two kafka topics. Then, it writes new events to that first topic and processing results in a third topic. Therefore, Kafka acts as the event store. Hope this drawing helps: RPC Request RPC Result | | ~~~~> Commands-| |---> Results ~~~~~~| |-->Aggregate--| ~> Input evs. -| |---> output evs. ~~~ |

Eureka Ribbon LoadBalancer Cache update delay

孤街醉人 提交于 2019-12-24 00:38:52
问题 I am setting up a micro service based application, where Aggregation layer / API gateway makes calls to micro services. Eureka is used for service discovery and Ribbon for providing a load balancing RestTemplate. Postman calls Aggregation--> Aggregation calls Micro service using Eureka/Ribbon/RestTemplate. I have 4 instances of one micro services type running on my machine on 4 different ports. Hitting the same REST endpoint repeatedly Postman causes the requests to get load balanced properly

How to shutdown dropwizard application?

别来无恙 提交于 2019-12-23 22:45:51
问题 I am trying to come up with a microservice using dropwizard. The documentation tells how to start the application, but says nothing about terminating it gracefully. Fir example, apache tomcat has both startup and shutdown scripts. So does anyone know how to terminate a dropwizard application other than pressing Ctrl+C of kill ? 回答1: Dropwizard Jetty has shutdown hooks. So kill -SIGINT <pid> works out really well. 回答2: Inspired by praveenag's answer, I dug into Jetty's code. If you start

Microservice based or Monolithic

亡梦爱人 提交于 2019-12-23 17:51:07
问题 I read a lot about Microservices and their structure and it seems, that there are a lot of advantages when it comes to maintainability. I want to build a mobile app with Spring Boot and Phonegap, which pulls news from RESTful Web Services. So I'm thinking f building it as a microservice so I can add other services without rebuilding the whole application. Because in future I might want to add other services. But is it really worth to build a Microservice based application for such a small