Questions tagged [spring]
Spring is a module based open source framework to build robust Java / Java EE applications.
310 questions
6
votes
3
answers
2k
views
How to communicate API Limit between multiple applications?
We currently have 3 Spring boot applications (with multiple instances across machines each) that communicate with an API via HTTP that is not in our hands.
This API has a limit on a per-day as well as ...
2
votes
2
answers
251
views
Best way to add asynchronous execution for already implemented synchronous process
I have a complex process implemented in Java Spring microservice.
Currently this process is triggered on user request and it is synchronously executed.
This often results in a gateway timeout.
...
3
votes
2
answers
512
views
Why do I need an authorisation server if my micro services can validate JWTs directly?
I'm working on a Spring-based micro service project and considering different approaches for handling authentication and authorization. Instead of setting up a dedicated authorization server, I'm ...
-1
votes
1
answer
226
views
Why was integration tests using Spring Test framework designed to need @Transactional annotation in the @Test method by default?
Based on the documentation on Spring testing: https://docs.spring.io/spring-framework/reference/testing/testcontext-framework/tx.html#testcontext-tx-enabling-transactions
Annotating a test method ...
0
votes
0
answers
94
views
Disable tenants in multi tenant SaaS app
I am building an app where I have tenants and each tenant can have multiple users. The users can do multiple things in the application and these functionalities also are kind of independent from each ...
2
votes
2
answers
787
views
How should I implement data access with jpa to meet Clean Architecture/DDD
For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate.
Do not use @ManyToMany or @...
3
votes
3
answers
1k
views
Should business logic classes be POJO only?
I read about three-tier architecture and I have a question: I read that in business logic (that is, what is in logic tier) there should be POJO classes, but in most Spring manuals these classes are ...
1
vote
0
answers
84
views
Best practice: slightly different logic on multi mapping endpoint
Suppose I've got a spring controller as follows:
⋮
@RestController
public class MyController {
⋮
@PostMapping(value = { "publicAPI/addItem", "internalAPI/addItem" })
...
6
votes
3
answers
1k
views
Hexagonal Architecture + Domain Driven Design. How to perform a correct implementation?
Currently, I am trying to implement these two architectures together with Java and Spring (although technology shouldn't matter I think).
But I'm encountering problems getting them to work together.
I ...
0
votes
2
answers
405
views
Where perform mapping in strict Domain-Driven Design?
I want to create an example application where we use a strict domain-driven design and layering (controller, service, repository). Most notably, we have a clear distinction between the domain and the ...
-3
votes
1
answer
129
views
How to format request and response
I am new to backend REST API development. I am creating the CRUD APIs for books using spring boot.
I have a model class lets say 'user'. It will have many fields, like id, name, email, status, ...
-2
votes
1
answer
203
views
Spring/Java multiple shared modules for different databases
I'm implementing a software based on the micro-service architecture using Spring/Java. Each micro-service connects to either a PostgreSQL or a MongoDB database. Is it standard practice to have a ...
0
votes
1
answer
150
views
Where to put getOrSave responsibility?
I have many repeated parts of service logic which just fetches object if it exists or returns a newly saved one.
I want to move it from service because it just clutters up the logic. But I do not ...
2
votes
3
answers
1k
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 ...
-3
votes
1
answer
174
views
Learn a framework on a project, or mix languages between backend services [closed]
I am designing my next project, which will do various domain-specific tasks, but all that will be controlled and used via a generic crud web app.
I have been professionally using Java with Spring for ...