Questions tagged [spring-boot]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
-2 votes
0 answers
15 views

Refresh code changes on multiple instances w/out restarting service in a Java Spring Boot Application with spring-actuator & bus refresh with Kinesis

I want to refresh/reload configuration changes without restarting the service. I have microservices built on Java 8 and Spring Boot. I have decided to achieve this with the help of **spring-boot-...
user avatar
2 votes
4 answers
209 views

What are the advantages of externalizing application configurations?

I was learning about micro services with spring boot and came across spring cloud config server which is used to exernalise application configuration.The advantage it state is that one can change the ...
user avatar
  • 129
-2 votes
0 answers
29 views

In Microservices environment, if there are multiple services tied up together in a Chaining manner then how below scenarios will be covered

If Microservice 1 ---> calls Microservice 2---> calls Microservice 3 and so on… 1. What should be the transaction rollback approach if let says the call between Microservice 2 and Microservice 3 ...
user avatar
-1 votes
2 answers
50 views

How to deal with upsert PUT requests in a Spring Boot web application without crossing service and controller layers?

I've got a pretty simple web service that I need to add a PUT endpoint for that can handle upserts. This application is primarily a middleware layer to handle logging, caching and instrumentation in ...
user avatar
0 votes
1 answer
30 views

Is there a set of guidelines on how to handle/code execution of Spring Microservices RESTful API calls?

I'm building a RESTful web api using Spring Microservices. I am following the Controller/Service/Repository Structure. Where can I find some guidelines on what the responsibility of each class should ...
user avatar
  • 753
0 votes
0 answers
34 views

For a SpringBoot REST API + React frontend independent CORS project, best method to implement messaging between users?

I have been looking into adding the messaging functionality to my application and I have been struggling to figure out the best approach to take. Everything seems very heavy and complex, I have been ...
user avatar
1 vote
4 answers
197 views

Are static classes/methods good for pure business logic?

I have a service class that performs some operations. One of the operations is a piece of code long enough to warrant extracting to a new class and unit test it in isolation: @Service public class ...
user avatar
2 votes
3 answers
370 views

What we called this design pattern and it is same as strategy pattern?

abstract class BaseService { public void doSomething(); } class AService extends BaseService { public void doSomething(){ // Do something... } } class BService extends BaseService { ...
user avatar
0 votes
0 answers
32 views

Test strategy for liquibase changes

I am part of a team that works on a SpringBoot application and we use liquibase for maintaining our database changes. Config data that has to be added/removed/modified goes as part of a change-set. ...
user avatar
1 vote
2 answers
2k views

Is it a good practice to Mock entity manager in spring boot unit testing

I currently design an API using spring boot. In my service layer, I use Entity Manager for accessing the database. I have provided a method in my service layer below as an example. public Object ...
user avatar
0 votes
0 answers
53 views

Design : How to divide the responsibility in micro services

I have two micro services built using spring boot, One micro service is: "payment" Which handles actions related to payments. Like creating a payment link. Getting the latest status of ...
user avatar
  • 101
0 votes
0 answers
47 views

Spring Cloud Gateway - combine service-to-service authentication with user authentication

We are trying to find the best option for applications from the Public Cloud being used by corporate (internal users) to be able to make authenticated calls to APIs published in the internal network. ...
user avatar
  • 9
0 votes
0 answers
52 views

spring boot jpa repositories vs hql queries vs native queries

I'm currently working on a Spring Boot project. I have a big dilemma between the usage of JPA repositories, HQL queries, and SQL native queries. Converting all query logic to a native query is a ...
user avatar
  • 1
0 votes
1 answer
53 views

How to design a rest api for updating collection(ArrayList) of Resource in Spring boot?

I have a resource called Client and it has the following attributes id, name, redirect URLs(ArrayList). class Client{ int id; String name; List<String> redirectUrls; } I have all CRUD ...
user avatar
0 votes
1 answer
93 views

How to define API notations for multiple tables data in the response

The question is specific to the API notation shown in the screen under the heading Table Name with the comment Joins Multiple Tables. I am using Spring Boot with JPA (Database: RDBMS) I have defined ...
user avatar
  • 103
1 vote
1 answer
87 views

Implementing transactional entity lockouts with Spring and JPA

Spring Boot/Java 8/MySQL here. I have a widgets table in my MySQL DB that is modeled by a JPA entity like so: @Entity @Table(name = "widgets") @Data public class Widget { @Column(name = ...
user avatar
0 votes
1 answer
1k views

Blacklist JWT tokens or whitelist JWT tokens

I am working on a Spring Boot web application. The REST APIs are secured by JWT tokens. Currently I have only access token generated (not implemented refresh token concept). My question is related to ...
user avatar
1 vote
2 answers
133 views

In Publish-subscribe pattern can a microservice publish message for itself

I am designing a somewhat complex flow in publish subscribe pattern using AWS SNS, SQS , Microservice and Lambda functions. To break the whole flow into multiple logical & smaller sub-flows I am ...
user avatar
0 votes
2 answers
68 views

What's the right way to handle authentication of users across 2 web applications

There are 2 independently functioning web applications. Web-app1: (Flutter+Django+Postgres). Web-app2: (Angular+Spring+Postgres). Each of the web-apps has its own user database and are functioning ...
user avatar
  • 3
0 votes
2 answers
178 views

Which design pattern to use to make a mix of in-sequence and parallel HTTP calls?

We have to make a bunch of HTTP calls from Java/Spring-Boot application which will be mix of in-sequence and parallel. Level 1 : We make 3 parallel calls to Services 1 , 2 and 3 Level 2: After service ...
user avatar
  • 111
0 votes
1 answer
120 views

How to use single Spring-Boot instance to cater to multiple environments?

We have a Spring-Boot Web application currently deployed to 7 environments (DEV, SIT, UAT, Pre-Prod, Prod, etc.). This application connects to other REST services, which has different URLs for each of ...
user avatar
  • 111
2 votes
4 answers
492 views

How to compare passwords which is stored in DB in encrypted form in secure way?

Recently In an interview I was asked this question - Question- If are storing passwords in encrypted format in DB and in future when user login into our website how will we perform authentication? Me:...
user avatar
  • 147
0 votes
1 answer
107 views

Does it make sense to create a WAR anymore?

This is more specific to spring boot projects and applications whose main USP is its APIs. Now that we can simply create a JAR file deploy it anywhere, what is the point of WARs? Is there a specific ...
user avatar
  • 143
-1 votes
2 answers
401 views

How to have dependency between two different microservices?

I am implementing quora like application in which I have Post(question, answers, comments, likes/dislikes) as one microservice and User details as another microservice. I need user details in the post ...
user avatar
0 votes
1 answer
87 views

Direct communication between message-driven bounded context

My project comprises of serveral bounded context which communicate with each other with RabbitMQ The front end of the project is written in C# and the backend is in Java. The RabbitMQ communication ...
user avatar
2 votes
1 answer
808 views

Refresh tokens by example using Angular and Spring Boot

I am designing out an app that would have an Angular frontend and Spring Boot (Java) backend. I was considering (but not married to) the prospect of JWT-based authentication: User logs in with ...
user avatar
1 vote
2 answers
645 views

Can DTO have helper method that operates on DTO fields?

I wonder where to add method that reads my dto WindowDto.getPath().getPoints() and based on this collections returns some value (that value will be needed in some different srevices in my app): public ...
user avatar
  • 121
0 votes
1 answer
314 views

Spring Boot + MongoDB project structure and database creation

I'm planning to start a new Spring Boot project with MongoDB. I'm very familiar with Spring Boot, but all of my past projects used MySQL. Each of my projects has the following directory, that holds ...
user avatar
  • 103
0 votes
0 answers
278 views

Spring boot, n-tier layer structure naming conventions

I am currently developing a huge project in my company with N-Tier Layer architecture using spring boot but I can not sure about the package and class namings. In our project, we have a complex ...
user avatar
  • 9
0 votes
1 answer
54 views

Normalize timestamp values or have multiple SQL queries

I have a Spring Boot application to implement a RESTful API. One of the GET requests have two query parameters: from and until (of type date). Those parameters are optional, so user-agents can send ...
user avatar
  • 109
1 vote
0 answers
44 views

Reusable module using spring framework with spring-boot application modules?

I have a maven module which will handle DB interactions for various scenarios. I want this module to use spring framework so we can leverage the standard DI and integration test capabilities. This ...
user avatar
-2 votes
1 answer
164 views

Handling Legacy Database with Spring Boot Java

We are given a task to create an Web Service API for a mobile application. The problem is we have to use a legacy database that is not normalized and its very tedious to work with. We are accustomed ...
user avatar
1 vote
0 answers
65 views

Multitenancy - Multischema DB and should we handle by individual microservice basis?

I am looking into the revamping my organization's application by moving from a monolithic into a microservice-architecture. My database is a multi-schema shared in one database. Each of these schemas ...
user avatar
-1 votes
2 answers
570 views

Common library for classes and communication between microservices?

I have been working on a project that is being built around a microservices architecture. We are thinking on using a message broker, such as RabbitMQ, for both synchronous (via RPC) and asynchronous ...
user avatar
0 votes
1 answer
90 views

Implementing a user ID system like Discords for a web app using Java Spring, JPA, Hibernate and MySQL

I’m trying to create a web application with a forum and user profile along with other functions. However I’m thinking about how I might implement an ID for each user. The best way I’ve seen other ...
user avatar
1 vote
2 answers
811 views

How to share entity classes (JPA) among projects, where not all have DB access?

So, I have project in which several WebServices will be created (REST). For the sake of simplicity, Lets name them A, B, and C. A and B handle different tasks, but both of them consume C, which is the ...
user avatar
-3 votes
1 answer
214 views

Springboot (Java) - Is mandatory for BDD the use of Cucumber?

I was wondering if its a requirement to consider BDD the use of Cucumber framework or other framework of test abstraction. Because I was playing around with @SpringbootTest and TestContainers(both ...
user avatar
-4 votes
1 answer
63 views

application can not handle certain amount of RPS when 3k+ sessions connected

i have a problem in my scalable Pub/Sub application that it can not take more than 30 RPS when big amount of sessions are open against it. first i will explain the application structure. the ...
user avatar
  • 21
0 votes
1 answer
108 views

Is an antipattern returning differente objects in a single rest method?

I have seen around the Internet several rest web services with the following behaviour. In case there are any errors, they return a Error object, otherwise they return, say, MyClass. See the ...
user avatar
0 votes
1 answer
5k views

Is it okay to have one Service with two different Repositories in Spring Boot MVC?

I have a backend Spring Boot API that should have one(?) endpoint that returns some statistics to display in a frontend. These statistics are calculated from data that comes from two different ...
user avatar
  • 109
1 vote
2 answers
187 views

How to design a process and use the business rules for sending alerts/notifications

Currently working on designing a process which demands me to send alerts like email notifications to the users which meet a business criteria(we can also call business rules). I want to make this ...
user avatar
1 vote
0 answers
25 views

Spring Security SAML and RSA session

This is probably a design/architectural question. My app uses RSA initiated SSO using SAML for authentication and from there on my app uses its own session to manage the request. There is a flaw in ...
user avatar
  • 119
-1 votes
1 answer
734 views

building a frontend for a microservice backend: architectures? (spring boot stack)

to summarize a bit my current situation: I am building a backend based on microservices using spring boot. These are aggregated behind an api-gateway. My intention is to consume these api's from both ...
user avatar
  • 111
0 votes
0 answers
98 views

oauth2 + angular - Most elegant way to pass the JWT auth token

I have an angular application, which is querying an API as a client (written on Spring Boot 2.2.1 + Spring 5.2.1) that supports 3rd party authentication over OAuth2. The API has altogether 3 different ...
user avatar
1 vote
0 answers
546 views

Design of Spring boot endpoint that returns large amount of data continously until complete

I'm developing a web application using Spring Boot and React, that needs to return information about hotels from different cities: As an input of the controller, I receive a list of cities that can ...
user avatar
  • 137
0 votes
2 answers
130 views

Microservices: how far should coupling / decoupling of application parts relying on the same data backends go?

I am in the process of migrating a pretty much monolithic PHP application to microservices. With the development pipeline, docker containerisation, CI/CD and scalability in mind, what would be the ...
user avatar
  • 133
-3 votes
1 answer
2k views

What do you think about DTOs in Spring Data JPA project?

First of all, I am not a junior programmer. I'm just looking for best-practice. How do you use entities and DTOs into your Spring Data JPA projects? Assume there is our layers: Repositories (as ...
user avatar
  • 25
2 votes
3 answers
100 views

A question on microservice boundaries around monitoring

I have a microservice, lets call it microservice A. It talks to another microservice's REST endpoint, lets call that one microservice B. I'm monitoring the health of microservice A using the ...
user avatar
-2 votes
1 answer
95 views

Property file, annotations or database tables for storing configurations

Which one is better property file, annotations or database tables for storing configurations related to a program? What are the advantages/disadvantages and what use cases are best suited for each ...
user avatar
0 votes
1 answer
83 views

To And From Date Validation in Model

In my Springboot project I need to perform a validation of the type validFromDate<validToDate. I was wondering whether would it be a good or bad practice to place a validation in the model itself (...
user avatar