Skip to main content
Share Your Experience: Take the 2024 Developer Survey

Questions tagged [spring-boot]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
49 views

Handling Distributed Transactions with CompletableFuture in Spring

I'm looking for an opinion about an approach for dealing with distributed transactions. In a Spring Boot program, how can I implement the following business process without sacrificing to code ...
hjoly's user avatar
  • 11
1 vote
3 answers
150 views

How can I avoid duplicate annotations when validating both Entity and DTOs?

I am using the Spring Boot framework to create a RESTFUL API and I need a way to avoid the duplication of validation rules when using multiple DTOs as request/response objects for my endpoints. Using ...
Marco Pierre White's user avatar
5 votes
5 answers
3k views

What to cover with integration tests?

I'm working on adding unit/integration tests to an existing project (Java/Spring Boot) and I've been investigating on how they are "separated" in order to cover the test cases and how to ...
leugimlenipse's user avatar
0 votes
0 answers
27 views

Bean Custom Constraint Validator in multiple projects which common domain model

I have multiple maven projects ( rest services ) with common domain model. I would not say micro services. Structure is build this way to eventually move towards mircoservices. All the maven projects ...
Bhalchandra K's user avatar
0 votes
0 answers
156 views

better structure of a software project to prevent circular dependencies

I am contacting you today regarding a recent problem with circular dependencies. It's about a Spring boot application that accepts data via a Rest API and then forwards it to an internal Spring ...
Phoenix's user avatar
  • 29
-1 votes
1 answer
575 views

Microservices architecture for spring boot application

I have a Spring Boot application which is containerized. The application has become huge with lots of complications and its difficult to maintain it. So I am thinking of breaking it into microservices....
Prasad Patil's user avatar
1 vote
1 answer
458 views

Designing Clean Architecture(Hexagonal) for a Spring Boot Application : Project Layout and Class Organization

I'm currently in the process of integrating Clean Architecture into my Spring Boot project and I'm seeking advice on the ideal project structure and the types of classes and projects that should be ...
shiningStar's user avatar
-2 votes
1 answer
72 views

How to Implement Spring Boot Endpoint for Confluent Cloud-Like Batch Payloads?

I'm currently working on a Spring Boot application where I need to create an endpoint similar to the one mentioned in the Confluent Cloud documentation (link). The cURL example provided in the ...
Manupriya Logus's user avatar
0 votes
0 answers
198 views

Should we use sessions instead of bearer tokens with OpenID Connect server-side authorization code flows?

I want to build an app with a SPA (Angular) frontend and a REST API (Spring Boot) backend. I want a modern account system for this app: users log in through OpenID Connect, using either a social login ...
Joshua Schroijen's user avatar
0 votes
1 answer
247 views

How to write custom implementation of a service/flow for a tenant in a multi-tenant microservice system?

I have a Java Spring boot microservice in production which supports multi-tenancy and the tenants are isolated at database level. This microservice exposes REST APIs for communication. During a ...
ashish.g's user avatar
  • 129
1 vote
1 answer
320 views

The recommended Spring Boot project structure leads to repetitive code

When implementing projects in Spring Boot (especially CRUD applications), I often find myself writing a lot of repetitive code that just calls functions and services from lower layers. For example, ...
Win32's user avatar
  • 13
-1 votes
2 answers
268 views

Where does a Spring Application reside in Hexagonal Architecture

During this weekend I read "Get Your Hands Dirty on Clean Architecture" by Tom Hombergs. I am working on a microservice that was born with Hexagonal Architecture in mind, so I was able to ...
Claudio Mezzasalma's user avatar
-1 votes
3 answers
161 views

Choosing an Approach for Microservice Communications

I'm developing a doctor-patient system that consists of two microservices, namely the "doctor" and "patient" microservices. Both doctors and patients share some common attributes, ...
omid's user avatar
  • 1
0 votes
1 answer
98 views

How to persist Objects with the same parent

I am trying to build a "world" consisting of Fields for simplicity lets say there is a water and town field i created two classes @Entity @Inheritance(strategy = InheritanceType....
Tator's user avatar
  • 103
0 votes
0 answers
376 views

What is the Best Practice for handling multiple Entities that behave identically?

Because I have multiple entities with unique fields, I need multiple repositories for each one even though each Entity will be handled exactly the same. What is the best way to handle these separate ...
dbrewster's user avatar
  • 139
0 votes
1 answer
2k views

Multithreaded processing of single REST requests

Background: We're providing an API that provides information about all users within a given group. Our API is a high level facade over another low-level REST API. To gather those information we first ...
das Keks's user avatar
  • 203
-1 votes
1 answer
223 views

When does a REST API stops being one in terms of state management?

As far as I understand, there is no certain boundaries for the RESTness of an API. However, I would like your help to understand how large and long (in terms of running time) a caching or state ...
yokus's user avatar
  • 7
-1 votes
1 answer
754 views

What is the recommended approach for loading a Java Keystore from memory in a SpringBoot application running in a Docker container?

I am looking for a solution to load a Java Keystore dynamically from memory instead of from a file on disk. Can you suggest any libraries or best practices for this scenario in the context of Java, ...
goodspeed's user avatar
  • 167
0 votes
2 answers
682 views

Best practice for storing a static pdf file in a web app

I've to store a static pdf with an user guide of my application. I'm using Spring boot and Angular 12, what is the best way to store it? Put the file on resource folder of Spring boot? Put the file ...
Accollativo's user avatar
-1 votes
1 answer
573 views

How to design my API that interacts with a third party API and persists to a database

I'm building a web app that will integrate with the Etsy REST API and persist information in a database for things like order information, listings, etc. Essentially a panel to manage Etsy orders and ...
juyebgastro's user avatar
0 votes
1 answer
2k views

Spring Boot - How to return mocked data based on spring profile

I have a Spring Boot REST API application that uses different profiles like dev, test, prod, etc It also makes a call to another API to retrieve some data like: Client ---> MYAPI ---> ...
dbnex14's user avatar
  • 119
0 votes
1 answer
1k views

JPA/Hibernate/Spring - What if M side of @OneToMany is not relevant for business logic?

I am writing a Spring Boot REST API using JPA, so I have my application layers consisting of controllers services repositories entities models for request, response, DTOs This question is mainly ...
dbnex14's user avatar
  • 119
0 votes
0 answers
805 views

How does Spring boot and Postgres handle the concurrent updates?

I want to understand how does Spring Boot and Postgresql DB handle the concurrent requests for updating a value in DB. Consider this example of facebook likes, if there are multiple instances of ...
Spring boot progammer's user avatar
0 votes
2 answers
3k views

Simple Java Spring Boot Cache for multi-container system

I have a requirement to cache some static data as it is being consumed by our system. There is a static API that gives a map of records and we are fetching the corresponding record based on request. ...
Hindol Dey's user avatar
0 votes
0 answers
443 views

Spring Boot: Best approach for aggregating DTOs over multiple services

I have the following situation in my spring boot application: I use unidirectional relationship modelling for my database entities, in order to prevent difficulties with a bidirectional approach. (...
msts1906's user avatar
4 votes
4 answers
834 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 ...
Arjun's user avatar
  • 149
-1 votes
2 answers
339 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 ...
Fulluphigh's user avatar
0 votes
1 answer
37 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 ...
Lucas T's user avatar
  • 753
1 vote
4 answers
1k 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 ...
KidCrippler's user avatar
2 votes
3 answers
1k 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 { ...
Naman Gupta's user avatar
1 vote
2 answers
10k 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 ...
Prasad Darshana's user avatar
0 votes
0 answers
110 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 ...
aravind's user avatar
  • 101
0 votes
1 answer
264 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 ...
Vijay Kambala's user avatar
0 votes
1 answer
497 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 ...
ravibeli's user avatar
  • 103
2 votes
1 answer
2k 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 = ...
hotmeatballsoup's user avatar
0 votes
1 answer
3k 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 ...
user14132461's user avatar
1 vote
2 answers
326 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 ...
user3001381's user avatar
0 votes
2 answers
82 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 ...
mAsK's user avatar
  • 103
0 votes
2 answers
813 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 ...
Smile's user avatar
  • 111
0 votes
1 answer
371 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 ...
Smile's user avatar
  • 111
2 votes
4 answers
2k 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:...
Loren's user avatar
  • 147
0 votes
1 answer
163 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 ...
rsp's user avatar
  • 143
-1 votes
2 answers
1k 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 ...
Spring boot progammer's user avatar
0 votes
1 answer
155 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 ...
Nishant123's user avatar
2 votes
1 answer
1k 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 ...
hotmeatballsoup's user avatar
3 votes
2 answers
2k 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 ...
Matley's user avatar
  • 141
0 votes
1 answer
493 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 ...
Maroun's user avatar
  • 103
0 votes
0 answers
584 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 ...
nsk's user avatar
  • 9
0 votes
1 answer
130 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
1 vote
0 answers
134 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 ...
emeraldjava's user avatar