microservices

Implementing authentication and authorization using Zuul Proxy, Oauth2 on REST Microservices

可紊 提交于 2019-12-03 09:00:36
I am trying to implement the above architecture in the workflow with Spring Boot. Web client makes a request to Resource Server (Microservices Endpoints) through Zuul Proxy. Zuul Proxy redirects to oauth2 server for authentication. Oauth2 redirects to Zuul Proxy if the request is authenticated or not. If not authenticated, Zuul redirects Web client with an unauthenticated response. If Authenticated, Zull proxy redirects to the requested microservice endpoint. Microservice endpoint checks if the user is authorized (user level access) to access the resource or not. Microservice also could make

How to Set Request Headers Using a Feign Client?

一个人想着一个人 提交于 2019-12-03 08:41:37
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 try to override the default Feign configuration but it kinda defeats the purpose of a declarative

How to self register a service with Consul

拈花ヽ惹草 提交于 2019-12-03 07:58:08
问题 I'm trying to self register my ASP.NET Core application to Consul registry on startup and deregister it on shutdown. From here I can gather that calling the http api [ put /v1/agent/service/register ] might be the way to go (or maybe not!). From my app, I thought I'll target the Startup class, starting with adding the my .json file public Startup(IHostingEnvironment env) { var builder = new Configuration().AddJsonFile("consulconfig.json"); Configuration = builder.Build(); } But now, I'm stuck

Microservices UI Frontend with Java and ReactJS Server Side Rendering

百般思念 提交于 2019-12-03 07:40:39
My current design is to have clients connect to my (Java) Web API Gateway using a browser, the Web API Gateway will call each (Java) microservice to get their JSON data and return it to the UI component that made the request on the client. The only client side rendering will be from each ReactJS UI component for recurring requests to the gateway. On the server side the full HTML view will be rendered prior to being sent back to the client. Client browser ▼ (Request Dashboard View) Web API Gateway ▼ (Request microservice JSON data) Microservice A JSON Data Microservice B JSON Data Microservice

What is the conceptual difference between Service Discovery tools and Load Balancers that check node health?

一个人想着一个人 提交于 2019-12-03 07:30:49
问题 Recently several service discovery tools have become popular/"mainstream", and I’m wondering under what primary use cases one should employ them instead of traditional load balancers. With LBs, you cluster a bunch of nodes behind the balancer, and then clients make requests to the balancer, who then (typically) round robins those requests to all the nodes in the cluster. With service discovery (Consul, ZK, etc.), you let a centralized “consensus” service determine what nodes for particular

Microservice to Microservice calls, authorization from a queue message

随声附和 提交于 2019-12-03 06:49:44
Context: I'm creating a cloud platform to support multiple applications with SSO. I'm using Keycloak for authentication and Netflix Zuul for authorization (API Gateway) thru Keycloak Spring Security Adapter . Each microservice expect an Authorization header, which contains a valid JWT, from which it will take the username (sub) to process the request. Each microservice-to-microservice call should go thru Netflix Zuul first, passing the Authorization header to maintain a stateless validation. That strategy allow to every microservice to know who is the user (sub) who is invoking the

How to manage secrets in a Microservice / Container / Cloud environment?

这一生的挚爱 提交于 2019-12-03 05:53:30
问题 Microservices and Cloud is a thing. Everyone is talking and writing about. Personally i am thinking a lot about this topics: How this can be used to benefit from? What are possible challenges? How can this speedup the daily development? And how to manage all things? One question that bothers me since a few days is "How to manage secrets in a Microservice / Cloud environment?". Imagine a company with 150 software engineers and various teams with various products. Every team is creating a

Microservices: REST vs Messaging

巧了我就是萌 提交于 2019-12-03 04:53:40
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 subscribe * Cache load event.. i.e. on start up, a service may need to load all data from a couple of other

Microservices: How to store source code of many microservices?

孤者浪人 提交于 2019-12-03 03:32:50
问题 Currently, I have 20 microservices for one project. And every microservice stored in separate GIT reposotiry. Subsequently, the number of services will increase to 200 (or more) . Every service has unit tests and integration tests. Every service has build in TeamCity (Continuous integration server). Question: How to store source code of 200 microservices for one project? In one repository or in separate repositories? 回答1: Unless those micro-services are tightly coupled (meaning it wouldn't

How to route in between microservices using Spring Cloud & Netflix OSS

强颜欢笑 提交于 2019-12-03 03:13:32
问题 During our development of microservices using Spring Cloud, we started out using Zuul as a proxy for any connection from the outside to microservices, and for any microservice needing to contact another microservice. After some time we made the conclusion that Zuul was designed to be an edge service (only proxying traffic from the outside to the microservices), and shouldn't be used for intermicroservices communication. Especially the way Spring Cloud recommends the use of eureka to make a