microservices

Abstracting away the persistence layer in GO [closed]

為{幸葍}努か 提交于 2019-12-08 02:17:10
问题 Closed . This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 2 years ago . So, I'm relatively new to the world of Go programming and was wondering what the community considers to be "best practice" when attempting to abstract away the persistence layer. In DDD this is often handled through the introduction of Repositories which exposes a set of Agreggates to an

Should an API Gateway Communicate via a Queue or directly to other μServices?

点点圈 提交于 2019-12-07 17:56:54
问题 I was wondering which of my two methods is more appropriate, or is there event another one? (1) Direct Direct communication between GATEWAY and μSERVICE A UI sends HTTP request to GATEWAY GATEWAY sends HTTP request to μSERVICE A μSERVICE A returns either SUCCESS or ERROR Event is stored in EVENT STORE and published to QUEUE PROJECTION DATABASE is updated Other μSERVICES might consume event (2) Events Event-based communication via a message queue UI sends HTTP request to GATEWAY GATEWAY

Java application: Sequence workflow pattern

左心房为你撑大大i 提交于 2019-12-07 15:00:37
问题 I have a spring web application. When a user calls save endpoint, system should execute many external calls to save the state in multiple microservices. However, those steps depend on each other. In other words I have a sequence of steps to perform. sequence pattern Just calling a set of steps one by one is not a big deal, I can just create class for each step and call them one by one doing appropriate modifications between the steps. However, each of the steps can fail and if it happens it

Should API gateway be responsible for authorisation?

一曲冷凌霜 提交于 2019-12-07 10:20:27
问题 Currently I have a monolith application with Java/Spring Boot the following endpoints: /login /logout /some-resource To access some-resource , the flow is following: The user makes a POST request to /login endpoint. If the credentials are correct, a JWT token is returned in header, otherwise a 401. The users sends the JWT token along with the request to /some-resource . If the token is valid, the resource is returned, otherwise 403. Now I want to split the monolith into 2 services:

microservice architecture questions about code resue, security and database sharing

空扰寡人 提交于 2019-12-07 08:45:36
问题 I have the following questions about micro service architecture How common code/utility-libs are being reused between different micro services? Where this common code is also being developed In my micro-service some services are for clients and some can be internal ( for other micro services to use). What is the best option to make internal services secure? What if two micro-services has to use the same database? Say they do totally different operations but using the same database table?

Unable to infer base url. This is common when using dynamic servlet registration or when the API is behind an API Gateway

♀尐吖头ヾ 提交于 2019-12-07 07:14:54
问题 I already went Why does springfox-swagger2 UI tell me "Unable to infer base url." and Getting an unexpected result while configuring Swagger with Spring Boot and not using Spring Security at all and for each service, I am using @EnableSwagger2 annotations. I'm following tutorial from link: https://dzone.com/articles/quick-guide-to-microservices-with-spring-boot-20-e and using gateway-service for the project to run instead of proxy-service . gateway-service.yml server: port: 8060 eureka:

Distributed transactions in microservices

梦想的初衷 提交于 2019-12-07 06:19:42
问题 I have 2 microservices S1 and S2 . S1 invokes S2 to update a data and then S1 inserts another data,But let's consider S1 fails,Then we need to rollback the data updated by S2 or else we'll be in inconsistent state. I also gone through Saga patterns.will it satisfy this inconsistency Can anyone suggest any better solutions for this? 回答1: Distributed transactions are problematic for most circumstances and they are bad for services Service Boundary – service boundary is a trust boundary. Atomic

Call Microservice from another Microservice within Docker

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-07 02:29:29
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 MediaTypeWithQualityHeaderValue("application/json")); //Sending request to find web api REST service resource

Rails: How to listen to / pull from service or queue?

邮差的信 提交于 2019-12-07 02:23:31
问题 Most Rails applications work in a way that they are waiting for requests comming from a client and then do their magic. But if I want to use a Rails application as part of a microservice architecture (for example) with some asychonious communication (Serivce A sends an event into a Kafka or RabbitMQ queue and Service B - my Rails app - is supposed to listen to this queue), how can I tune/start the Rails app to immediately listen to a queue and being triggered by event from there? (Meaning the

What is the difference between an API-Gateway and an Edge Service?

让人想犯罪 __ 提交于 2019-12-06 23:55:33
问题 I understand the concept behind an API gateway as described by Richardson: http://microservices.io/patterns/apigateway.html But what is the difference to an Edge service. Is this a concrete implementation of the API gateway pattern? 回答1: Technically, an API Gateway is the API exposed to the public (REST, etc.), and an Edge Service is a service running on the API resolving the proxying, routing, etc. There could be many edge services on the Gateway. But practically there is usually only one