microservices

REST Communication between microservices - Abstract away from host or port in REST call

安稳与你 提交于 2019-12-08 13:25:15
问题 I just started diving into the microservices topic, so please excuse if this is a stupid question. Let's say I have two microservices, one providing a REST api and one being an angular microservice for a nice frontend. The angular microservice is expected to communicate with the other microservice. I saw many examples implementing this and its basically not a big deal. I am well aware of that. However, in all these examples I saw something like this in the angular microservice: this.http.get(

What is the difference between an API and Microservice?

断了今生、忘了曾经 提交于 2019-12-08 12:04:18
问题 I create my API rest with Django, but I don't understand how convert an API to micro services, I don't understand the real difference between these. I see an API like a micro service, but I don't know convert an entire API in micro service, I need create micro web servers? Please, I can't understand a micro services, and I need understand this. 回答1: A microservice exposes it's interface, what it can do, by means of an API. The API is the list of all endpoints that a microservice respond when

Java 8 LocalDate displaying in swagger

醉酒当歌 提交于 2019-12-08 12:02:35
问题 I have a DTO which contains field of Java 8 LocalDate type. With Jackson annotations it's possible to set format to ISO.DATE and everything works good. But Swagger (I have version 2.+) see the LocalDate.class as object LocalDate { month (integer, optional), year (integer, optional) } (That's true but...) I want to dipsay this as string with format as it works with util.Date . How can I solve it? 回答1: I was facing same problem, so I added @Bean public Docket docket() { return new Docket

Microservice Architecture dependency

六月ゝ 毕业季﹏ 提交于 2019-12-08 11:15:34
I have read a lot about microservice architecture but there is one thing that I dont understand how to achieve and hope you can help me with this... Lets say I have a web-api-endpoint that recieves orders that an OrderMicroservice is responsible to handle. When order is put Inventory must be updated so OrderMS publish an event to subscribers (pub/sub using for example Nats) and InventoryMS will update the inventory due to it is subscribing to current event/message....I want to have a loose coupled architecture and use asynch calls to modules/MSs thats are interested in given info. Given

Microservice Architecture dependency

空扰寡人 提交于 2019-12-08 08:15:28
问题 I have read a lot about microservice architecture but there is one thing that I dont understand how to achieve and hope you can help me with this... Lets say I have a web-api-endpoint that recieves orders that an OrderMicroservice is responsible to handle. When order is put Inventory must be updated so OrderMS publish an event to subscribers (pub/sub using for example Nats) and InventoryMS will update the inventory due to it is subscribing to current event/message....I want to have a loose

Using Tomcat in Production for Spring Boot apps

一世执手 提交于 2019-12-08 05:50:37
问题 As a novice with Spring Boot , I need to know the following as I could not find google results in a straight forward manner. What application servers do they really use for deploying those Spring Boot applications in real life? Is Tomcat really used by companies - if so do they achieve it using clustering? 回答1: Spring boot has an inbuilt Tomcat server, it's simply run from Java. The Tomcat is built into the jar, so it's the same in any environment. Here is a typical spring boot jar, with the

How do you set up two microservices that both use https port?

随声附和 提交于 2019-12-08 04:59:00
问题 I have one microservice that is a Asp.Net Core stateless service. The service runs fine and i can access at https://myazureresource.eastus.cloudapp.azure.com/controller/method. My ServiceManifest.xml is: <Resources> <Endpoints> <Endpoint Protocol="https" Name="EndpointHttps" Type="Input" Port="443" /> </Endpoints> </Resources> And MyService.cs is: protected override IEnumerable<ServiceInstanceListener> CreateServiceInstanceListeners() { return new ServiceInstanceListener[] { new

How to execute efficient communication for multiple (micro)services?

对着背影说爱祢 提交于 2019-12-08 04:02:13
问题 Case: Software build with many microservices and internal services. The doubt is how to manage performance issues (network latency, size of resource) getting multiple resources from many microservices at once. I Just can not imagine making 20 HTTP requests to access all necessary resources. 回答1: In order to reduce the number of requests made you might create a facade that encapsulates incoming API calls. This enables you to get rid of expensive network roundtrips. Netflix blogged about a very

org.springframework.security.oauth2.common.exceptions.InvalidGrantException: Bad credentials

一曲冷凌霜 提交于 2019-12-08 03:16:50
问题 I'm developing Spring Boot + Authorization Server + OAuth Resource Server . In this example I can easily query though postman over spring-microservices-oauth-server and get the protected data. I created the client to access the data which postman is doing. But I am getting below error, which doesn't get clear to me. Using Spring Boot v2.1.1.RELEASE and spring-cloud-dependencies version Greenwich.RC2 . Servlet.service() for servlet [dispatcherServlet] in context with path [] threw exception

Consul deregister 'failing' services

∥☆過路亽.° 提交于 2019-12-08 02:23:40
问题 I have consul running on Consul v0.5.2 version & services running in Mesos. Services keep moving from 1 server to another. Is there way to deregister services in consul that are in 'failing' state? I am able to get the list of services in failing state using this curl curl http://localhost:8500/v1/health/state/critical Issue that we are seeing is over a period of time in consul UI we have stale data & making the whole UI unusable 回答1: Consul by default do not deregister unhealthy services