microservices

File upload spring cloud feign client

非 Y 不嫁゛ 提交于 2020-01-01 07:21:32
问题 When make a post request from one microservice to another using feign client of spring cloud netflix, I get the following error in Postman : { "timestamp": 1506933777413, "status": 500, "error": "Internal Server Error", "exception": "feign.codec.EncodeException", "message": "Could not write JSON: No serializer found for class java.io.FileDescriptor and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS); nested exception is

How to offer multiple versions of an API with different database schemas?

﹥>﹥吖頭↗ 提交于 2020-01-01 05:28:07
问题 In Kevin Goldsmith's 2015 talk about microservices at Spotify (from 15:25 - 17:43), he mentions that when they create a new version of an API they just create a new server, and keep the old server running with the old version for as long as there are still clients calling it (in this case, a smart lamp with Spotify embedded on it). I am confused about how they would be able to maintain and offer older versions for potentially years, when surely there would be database schema changes during

How to share entity between REST service between two microservices?

╄→гoц情女王★ 提交于 2020-01-01 04:44:07
问题 I have created two micro-services using java. I need to make a REST api call from service A to service B. The data sent will be in JSON format. Using jax-rs I need to create entity class in both the service. Since both the entity class be same in both the projects. Do i Create an common jar and use is for all my entity/domain objects? Does this make my microservice more tightly coupled? Do i create the same class in both the microservice projects? This will just mean repeating the work in

Netflix Feign - Propagate Status and Exception through Microservices

本小妞迷上赌 提交于 2020-01-01 03:58:06
问题 I'm using Netflix Feign to call to one operation of a Microservice A to other other operation of a Microservice B which validates a code using Spring Boot. The operation of Microservice B throws an exception in case of the validation has been bad. Then I handled in the Microservices and return a HttpStatus.UNPROCESSABLE_ENTITY (422) like next: @ExceptionHandler({ ValidateException.class }) @ResponseStatus(HttpStatus.UNPROCESSABLE_ENTITY) @ResponseBody public Object validationException(final

How to Set Request Headers Using a Feign Client?

两盒软妹~` 提交于 2020-01-01 03:29:12
问题 We are developing a suite of Microservices using Spring Cloud framework and one of the the things that we need to do is to set request headers. I know I can pass a parameter @RequestHeader to a Feign method but the value needs to come from another bean. I don't know if SPEL can be used for a Feign param value. I was thinking that this is a common enough use case for most clients so there'd be some examples, but so far I've not found any. Of course I can dig through the Spring course code and

Microservices not registering on all Eureka Instances

杀马特。学长 韩版系。学妹 提交于 2019-12-31 03:48:39
问题 Spring Boot version: 2.1.6.RELEASE Spring Cloud Version: Greenwich.SR1 Objective is to set up two instances of Eureka Servers in a cluster and have all microservices registered to both, in order to achieve HA. Currently I am testing this on my local machine running Ubuntu 18.04. So as mentioned in the official docs, I have set up the peer to peer awareness of Eureka Instances. On bringing both the Eureka Server Instances up, on the dashboard of Instance-1(Port 8080) under available replicas

Spring Boot project setup design decisions

孤街醉人 提交于 2019-12-30 10:38:41
问题 We will be using Spring Boot to create services. Our initial idea would be that each service (not necessarily microservice) would be self-contained, and deployed as a .jar file. Maven for build. I'm wondering what would be a good Spring Boot project structure, as each service would be self-contained, but I'm guessing services will still have some code/entities that can or should be reused between services Options: Each service is a standalone Spring Boot project. Implements only the entities,

Spring Boot project setup design decisions

我与影子孤独终老i 提交于 2019-12-30 10:38:13
问题 We will be using Spring Boot to create services. Our initial idea would be that each service (not necessarily microservice) would be self-contained, and deployed as a .jar file. Maven for build. I'm wondering what would be a good Spring Boot project structure, as each service would be self-contained, but I'm guessing services will still have some code/entities that can or should be reused between services Options: Each service is a standalone Spring Boot project. Implements only the entities,

Istio envoy 504 gateway timeouts after 15 seconds for outbound connections

眉间皱痕 提交于 2019-12-29 08:23:35
问题 Background: I am using istio 1.2.5 I have deployed istio using helm default profile from the istio documentation by enabling the tracing, kiali and logLevel to "debug". My pods and service in istio system namespace looks like this: (⎈ |cluster-dev:default)➜ istio-1.2.5 git:(master) ✗ k pods -n istio-system NAME READY STATUS RESTARTS AGE grafana-97fb6966d-cv5fq 1/1 Running 0 1d istio-citadel-76f9586b8b-4bbcx 1/1 Running 0 1d istio-galley-78f65c8469-v5cmn 1/1 Running 0 1d istio-ingressgateway

Is the HTTP method PURGE idempotent in Varnish?

半城伤御伤魂 提交于 2019-12-29 01:45:17
问题 Is the HTTP verb PURGE idempotent? If I send the same PURGE request twice will I receive 200 the second time? I have a microservice that invalidates a Varnish cache before publishing a message into a rabbit queue. In case of purge failure our need is to just log and continue the execution. The queue consumer has to get the latest status of the resource from the Varnish cache. Will a new purge request (before actually requesting the resource from varnish) from the second microservice return