microservices

Change only 1 Parameter with PutRequest?

半世苍凉 提交于 2020-01-26 04:44:06
问题 I have a question. Is it possible to be able to change only one parameter in a PutRequest? I didn't find anything on the internet about this. @GetMapping("/templates/{user_name}/{template_id}") public Template retrieveTemplate(@PathVariable("user_name") String user_name,@PathVariable("template_id") int template_id) { return templateRepository.findByTemplateIdAndUserName(template_id, user_name); } This is my GetRequest and I want that only the parameter template can be changed. 回答1: As Tom has

Message encryption in kafka streaming

有些话、适合烂在心里 提交于 2020-01-25 06:49:14
问题 I am recently trying to play with kafka streaming for some sensitive data processing. The goal I wish to achieve is that while the sensitive data is encrypted, the power of microservice architecture is not jeopardised, i.e., losely coupled services and stream data processing. My question is, in kafka streaming, is it possible that I decrypt an incoming message using one key and encrypt it again with another key? I kind of got a plan, but as I am not familiar with kafka streaming, I can not

Java pass variable into mapped DTO method?

核能气质少年 提交于 2020-01-25 01:05:23
问题 I have Spring Boot Application with implementation containing methods with following functions. The implementation uses 2 DTO's to bind data with. Is there an appropriate way how I could pass value from JAY to value where ' 10.00 ' is hardcoded? I have main issue with ' this::convertProfileToProfileCreditDTO ' is it possible to pass a parameter in this expression? I have used Java DTO Object search mechanism? for insipration If I try to add a parameter within code snipped below the this:

Kafka conditional producing/consuming

社会主义新天地 提交于 2020-01-25 00:48:12
问题 I have this situation: microservice MS1 has a db, let's say with N records, and an external source provides new data that, if valids, should be persisted validation process is performed by a microservice MS2 that is a consumer of a kafka topic T1, on which MS1 sends the new data the validation of the potential N+1 record involves query on all the previous N records. If the validation is successful MS2 produces the result on topic T2, on which MS1 is consumer,so it can persist the new,valid

Kafka conditional producing/consuming

痞子三分冷 提交于 2020-01-25 00:48:06
问题 I have this situation: microservice MS1 has a db, let's say with N records, and an external source provides new data that, if valids, should be persisted validation process is performed by a microservice MS2 that is a consumer of a kafka topic T1, on which MS1 sends the new data the validation of the potential N+1 record involves query on all the previous N records. If the validation is successful MS2 produces the result on topic T2, on which MS1 is consumer,so it can persist the new,valid

In the microservices architecture, why they say is bad to share REST Client libraries? [closed]

核能气质少年 提交于 2020-01-24 21:21:31
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . We have 15 services build with Java Spring, they talk each other using REST . Each time we add a new service to the pool we create from scratch all the code, including rest client code that will talk to other Services and the POJO classes used to map the resource(s) being

Testing Java Spark Microservices app that implements SparkApplication interface

﹥>﹥吖頭↗ 提交于 2020-01-24 15:14:46
问题 I am trying to figure out how to test a web/rest services written in Java Spark and there is not many tutorials on how to do that. It is tricky to find answers due to confusion between Apache Spark and Java Spark . I came across this resource but, I couldn't get it to work the way I had expected. There is also this resource and examples in Java Spark github but they all probably use embedded server. Anyway, Assuming that I have the following service public class RestService implements

Testing Java Spark Microservices app that implements SparkApplication interface

拥有回忆 提交于 2020-01-24 15:14:26
问题 I am trying to figure out how to test a web/rest services written in Java Spark and there is not many tutorials on how to do that. It is tricky to find answers due to confusion between Apache Spark and Java Spark . I came across this resource but, I couldn't get it to work the way I had expected. There is also this resource and examples in Java Spark github but they all probably use embedded server. Anyway, Assuming that I have the following service public class RestService implements

How to serve static contents in a kubernetes application

我只是一个虾纸丫 提交于 2020-01-24 13:36:07
问题 I have a small java webapp comprising of three microservices - api-service , book-service and db-service all of which are deployed on a kubernetes cluster locally using minikube. I am planning to keep separate UIs for api-service and book-service , with the common static files served from a separate pod, probably an nginx:alpine image. I was able to create a front end that serves the static files from nginx:alpine referring to this tutorial. I would like to use ingress-nginx controller for

Spring Boot REST API Endpoint Mapping best practice

笑着哭i 提交于 2020-01-24 01:56:06
问题 I am using bellow endPoint URL Mapping with HTTP Methods like ( POST,DELETE,GET,PUT) POST for Create a new Trade - @PostMapping("/trade") DELETE for Delete a Trade with specific id - @DeleteMapping("/trade/{id}") GET for Get details of specific Trade - @GetMapping("/trade/{id}") PUT for Update Trade details - @PutMapping(“/trade/{id}”) GET for Retrieve all Trade list of collection - @GetMapping("/trades") if I am missing anything here Please suggest 回答1: Add API version like @RestController