microservices

Microservice, amqp and service registry / discovery

为君一笑 提交于 2020-01-23 06:24:25
问题 I m studying Microservices architecture and I m actually wondering something. I m quite okay with the fact of using (back) service discovery to make request able on REST based microservices. I need to know where's the service (or at least the front of the server cluster) to make requests. So it make sense to be able to discover an ip:port in that case. But I was wondering what could be the aim of using service registry / discovery when dealing with AMQP (based only, without HTTP possible

Microservices Why Use RabbitMQ?

折月煮酒 提交于 2020-01-22 04:49:11
问题 I haven't found an existing post asking this but apologize if I missed it. I'm trying to get my head round microservices and have come across articles where RabbitMQ is used. I'm confused why RabbitMQ is needed. Is the intention that the services will use a web api to communicate with the outside world and RabbitMQ to communicate with each other? 回答1: In Microservices architecture you have two ways to communicate between the microservices: Synchronous - that is, each service calls directly

Microservices: what are pros and cons?

十年热恋 提交于 2020-01-22 04:21:09
问题 What are pros and cons of using microservices in comparison with alternative architectures? Is there a rule of thumb when microservices should be used? 回答1: Pros Sam Newman in Building Microservices, enumerates the key benefits of Microservices as following: Technology Heterogeneity With a system composed of multiple, collaborating services, we can decide to use different technologies inside each one. This allows us to pick the right tool for each job, rather than having to select a more

How to pass opentracing data using json

时光毁灭记忆、已成空白 提交于 2020-01-22 02:35:53
问题 My API-gateway starts a tracer and a span for validate email. Then its passed to user-service for validation. I want to pass this span details to user-service as a json object and start another span as a tracer.start_span('Validate Email', child_of=API_gateway_span) To do it, I have used following struct: type checkEmail struct { GatewayTracerSpan opentracing.SpanContext `json: gatewayTracerSpan` Email string `json: email` Uuid string `json: uuid` } In function() validateEmailSpan :=

POST data faild using http.NewRequest

空扰寡人 提交于 2020-01-21 19:15:09
问题 I am trying to pass data from one golang service to another using http.NewRequest() . To do it I used following code: httpClient := http.Client{} userserviceUrl := "http://user:7071/checkemail" form := url.Values{} form.Set("uuid", uuid) form.Set("email", email) b := bytes.NewBufferString(form.Encode()) req, err := http.NewRequest("POST", userserviceUrl, b) if err != nil { log.Println(err) } opentracing.GlobalTracer().Inject( validateEmailSpan.Context(), opentracing.HTTPHeaders, opentracing

how to get api gateway address in order to call it from angular container in docker compose

隐身守侯 提交于 2020-01-17 06:55:35
问题 i have a docker compose file in which there are several containers among which there are an api gateway and another one with an angularjs application (the website of this stack). The api gateway is concerned to call correct apis of several containers presents in the compose file. But i need to call the api gateway from the website (angular container) and i would like to know what is the best practices for get the address of the api gateway container in order to call it from angular container

GAE Microservices with dedicated Cron Jobs per microservice

安稳与你 提交于 2020-01-16 07:32:13
问题 Can different microservices in GAE, own dedicated cron jobs? Background We have written multiple services on GAE microservices application. One micronservice say Service1(default) [JAVA in GAE Standard environment] has 10 cron jobs, wheareas another microservice say, Service2 [Python in GAE Flexible environment] has 5 other cronjobs. When we deploy both the services, cron jobs get replaced with the latest service cron jobs. I know that Task Queue is shared resource in GAE Microservices and

Call Microservice from another Microservice within Docker

柔情痞子 提交于 2020-01-14 02:50:06
问题 I created several Microservices in C# that are running on docker in windows, I need to call Microservice from another Microservice so I used this way to call: [HttpGet("GetOrder/{Object_ID}")] public Order GetOrder (int id) { string Baseurl = "http://189.29.0.100/"; ….. using (var client = new HttpClient()) { //Passing service base url client.BaseAddress = new Uri(Baseurl); client.DefaultRequestHeaders.Clear(); //Define request data format client.DefaultRequestHeaders.Accept.Add(new

is kafka reliable when used as a message bus in micro services

旧城冷巷雨未停 提交于 2020-01-13 19:15:07
问题 I am using kafka as a message bus for Micro Service architecture, hence multiple services listen on a topic for a message. Therefore, the services are highly dependent on the topic to be live. But, there are many instances where I get leader not available , broker not available and leader= - 1 on the topics. Now, I am not sure if I can rely on the kafka topics, as services get interrupted when there are issues on the topics with cause issues in the platform. Can someone throw some light on

is kafka reliable when used as a message bus in micro services

你离开我真会死。 提交于 2020-01-13 19:14:08
问题 I am using kafka as a message bus for Micro Service architecture, hence multiple services listen on a topic for a message. Therefore, the services are highly dependent on the topic to be live. But, there are many instances where I get leader not available , broker not available and leader= - 1 on the topics. Now, I am not sure if I can rely on the kafka topics, as services get interrupted when there are issues on the topics with cause issues in the platform. Can someone throw some light on