microservices

File upload spring cloud feign client

感情迁移 提交于 2019-12-03 21:48:28
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 com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class java.io

Spring boot Kubernetes Service Discovery

点点圈 提交于 2019-12-03 21:21:53
I am running into issues with Kubernetes Service Discovery on Spring Boot applications. I should be able to discover the services whether my spring boot application is running within or out of Kubernetes cluster. Our local development won't be on k8s cluster. I am using Service Discovery via DNS. I tried using spring-cloud-starter-kubernetes <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-kubernetes</artifactId> <version>0.2.0.RELEASE</version> </dependency> As per documentation you should be able to autowire DiscoveryClient and good to go @Autowire

Product Versioning Microservices

不问归期 提交于 2019-12-03 18:47:20
问题 I go into microservices architecture based on docker and I have 3 microservices, which together create one product for example "CRM system". Now I want my client to be able to upgrade his product, whenever he wants to. I have 3 different versions of my microservices, which one should client see? I guess product version should be independent of microservices, because copying one of the microservices version would make me go into more trouble than having no version at all. So is there any

Event publisher for ASP.NET Web Api

跟風遠走 提交于 2019-12-03 17:02:38
I have started to work with micro-services and I need to create an event publishing mechanism. I plan to use Amazon SQS. The idea is quite simple. I store events in the database in the same transaction as aggregates. If user would change his email, event UserChangedEmail will be stored in the database. I also have event handler, such as UserChangedEmailHandler , which will (in this case) be responsible to publish this event to SQS queue, so other services can know that user changed email. My question is, what is the practice to achieve this? Should I have some kind of background timed process

Microservices: REST vs Messaging

北城以北 提交于 2019-12-03 16:27:19
问题 I heard Amazon uses HTTP for its microservice based architecture. An alternative is to use a messaging system like RabbitMQ or Solace systems. I personally have experience with Solace based microservice architecture, but never with REST. Any idea what do various big league implementations like Amazon, Netflix, UK Gov etc use? Other aspect is, in microservices, following things are required (besides others): * Pattern matching * Async messaging.. receiving system may be down * Publish

Service discovery on aws ECS with Application Load Balancer

♀尐吖头ヾ 提交于 2019-12-03 15:55:17
I would like to ask you if you have an microservice architecture (based on Spring Boot) involving Amazon Elastic Container Service (ECS) with Application Load Balancer(ALB), service discovery is performed automatically by the platform, or do you need a special mechanism (such as Eureka or Consul)? From the documentation (ECS and ALB) is not clear you have this feature provided. I have talked this with the Amazon support team and they respond the following: "...using Service Discovery on AWS ECS[..] just with ALBs. So, there could be three options here: 1) Using ALB/ELB as service endpoints

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

泄露秘密 提交于 2019-12-03 15:25:47
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 that timeframe? I can see a few possible solutions, but none of them seem very reasonable: Using the same

How to share entity between REST service between two microservices?

自闭症网瘾萝莉.ら 提交于 2019-12-03 13:41:40
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 both the projects? Is there a better way to communicate between the sevices? In terms of having your two

Multi-Tenant Authentication with AWS Cognito

老子叫甜甜 提交于 2019-12-03 11:40:46
问题 My current project is in AWS, using Cognito and microservices with Lambda. We have designed the microservices using DDD and are in the process of implementing basic functionality. However, there is a business need for users of the API to be able to be categorised into the client company that they work for, and only be able to access data for that client company as well as any role-based authentication we will have. This isn't a full multi-tenant solution as every user will be working with the

Netflix Feign - Propagate Status and Exception through Microservices

对着背影说爱祢 提交于 2019-12-03 09:53:20
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 HttpServletRequest request, final validateException exception) { log.error(exception.getMessage(),