Questions tagged [spring]

Spring is a module based open source framework to build robust Java / Java EE applications.

Filter by
Sorted by
Tagged with
1
vote
0answers
17 views

What are the ways to trigger Root Actor from Rest controller?

I am new to Akka, so not sure if this is an easy question. My current setup is something like this : I have a Rest Controller, which is getting lots of requests from different hosts. These requests ...
1
vote
2answers
81 views

Angular + Spring Application

I use Spring for backend work and Angular for frontend and maintain each in separate repositories. This was because I considered both the frontend and backend completely separate projects, IE a new ...
0
votes
1answer
53 views

Jpa Repository save inside a for loop

I have this requirement: Csv Upload (using opencsv) Should display if the record is inserted (if it doesn't exist in the db) or updated (if it exists). Eg.: 5 records inserted 2 records updated. ...
1
vote
2answers
42 views

JHipster generated endpoints adds header messages

I'm adding new functionality to an existing application it was done using JHipster. I've notice that some endpoints follow this pattern: return ResponseUtil.wrapOrNotFound(updatedUser, ...
1
vote
2answers
56 views

How to abstract the data layer when using Spring Data?

I have decided to try to create my own board game implementation. Probably going to use a REST-api to expose the contract. I'll figure out what database, communication, ... tools I'm going to use once ...
1
vote
0answers
34 views

Javax Validation Annotations in Spring - is it always appropriate? [closed]

I've recently become more fond of javax validation annotations and creating custom ones when I feel they may be appropriate. But... I can't figure if it's design-appropriate to use them for everything....
0
votes
2answers
85 views

User friendly webapp configuration

I'm planning to develop a web application that would run on-premise at the customer. I'm quite unsure about the whole process of setting up the site in a user-friendly way, but mostly disturbed by the ...
-1
votes
1answer
67 views

Pattern for for REST API who's response depends on behavior of requests to other services

Some one help me with my design paralysis! Assume a microservice (probably going to be implemented in Spring Boot) that has implemented an run of the mill REST API, and after receiving an initial ...
0
votes
0answers
37 views

Two JPA read/write Entities vs SpringJdbcTemplate for implementing CQRS without event sourcing?

So we are trying to implement DDD and CQRS (without event sourcing). I am need of clarity about the implementation details (Spring + JPA). DDD with multiple small aggregate roots require @Entity ...
0
votes
2answers
106 views

performance suggestions on Aggregate root containing thousands of child entities

I understand that DDD is a design concept and implementation through ORMs are tricky but help me understand how would you solve this problem? So here is my confusion on changing on aggregates only ...
0
votes
2answers
65 views

What to test when testing an API? [closed]

When testing an API (with, for example, Java), what parts should I actually be testing when calling methods of my Controller class (e.g. a Spring RestController)? For example, lets say I've got a ...
2
votes
4answers
130 views

Make a class depends on its own ports instead of injecting dependency interfaces

I just have an idea about dependency management in Spring IOC environment that seems to be better than the typical approach, but I am not sure because I can't find any references or example out there ...
0
votes
0answers
291 views

dealing with too many DTO / Java

We are building an pseudo-rest API (because no body cares/funds for a full blown rest API for internal use - which is OK). So we have elements of Rest API (links for resources, API naming conventions ...
0
votes
2answers
107 views

Does creating multiple REST services calling each other from a monolithic EJB application right approach to make them microservices later?

We are doing an architectural refactoring to convert a monolithic J2EE EJB application to Spring services. In order to do that I'm creating services by breaking the application against the joints of ...
1
vote
1answer
76 views

Is the way I am doing client-side rendering bad practice? [closed]

I am working on my first web development project, SQLite4Web. Long story short: SQLite4Web is a web interface for SQLite database files. The user can access their database via /db/{dbToken}, where ...
1
vote
1answer
68 views

Spring Boot Controller Unit Test Strategy

All of the controllers in our project are as dumb as we can make them. Rightfully so, they simply validate the incoming payload, hand the request over to a service layer, and return whatever response ...
1
vote
3answers
285 views

How to reduce dependency on IOC Framework (Frameworks in general)

I was watching a presentation by Uncle Bob. In the end of that presentation (last 10 min), He argued that we should abstract everything (Even frameworks) from our business logic. JAVA EE does a great ...
0
votes
0answers
40 views

Messaging engine architecture with front-end and ORM layer (spring)

I'm looking to push my first QuickFixJ messaging engine into production, and I would like to know the best way to do so. Bear with me. The gist of the responsibilities is as follows: Through ...
-2
votes
1answer
187 views

How to serve the front-end in a Spring microservice architecture?

I want to create the following distributed system: Spring back-end microservices containing the domain logic, a UAA (authentication) service, a Eureka service registry/discovery, a Spring Cloud Config ...
1
vote
0answers
130 views

Performance impact of JPARepository save() on a large database table with index

We have a few tables with a large amount of data and with indexes on those tables to help in faster retrieval. We are also using Spring Data JPA JpaRepository for adding data to those tables using the ...
0
votes
0answers
58 views

Two Web clients and Java server (HTTP and Websockets)

I have 3 software components of a Web Application: 1. JS-client application 1 (JSApp1) 2. Java Spring (REST and Websockets) server app (SRV) 3. JS-client application 2 (JSApp2) My current task is to ...
0
votes
1answer
92 views

Using Spring Boot's @ConfigurationProperties without violating Law of Demeter

My apps commonly have one or more prop holders. These holders contain config data used in the app such as: @Component @ConfigurationProperties(prefix="app.orders") @Data //lombok public class ...
1
vote
1answer
100 views

Handling an empty path variable request

I have a scenario where I can take a student Id as input via a part variable and return some data back as JSON objects where JavaScript handles the response as a part of AJAX call. Suppose the method ...
3
votes
1answer
148 views

Java inheritance error handling scenario

I looked multiple places for some advice on how to solve this before asking this question, but I couldn't find something similar to this. So I have the following scenario in Java Spring Integration ...
0
votes
1answer
49 views

Should I postfix application.yml?

My project structure (Spring / maven): src / main / resources / application.yml src / test / resources / application.yml This is working well (when I launch test, it takes the test application.yml). ...
-1
votes
2answers
126 views

Dealing with data download which could take days to download

I have a situation on the front end where a user clicks on “Download” button and the query behind the scenes is going to take over a day. I have a Spring boot web app running as far as web services ...
0
votes
1answer
119 views

Java Design Pattern to Use for switching between 2 different endpoints

I have a legacy service that is running on-prem and have built a new service that runs on cloud which provides the same functionality. I have another java (spring) service which consumes the on-prem ...
1
vote
2answers
787 views

Streaming file content efficiently without risking resource leaks

I have to rectifiy an application that basically serves content by using two REST endpoints. Both endpoints transfer files to the browser, one endpoint does so by providing the file in binary format, ...
3
votes
2answers
205 views

How do entities, DTO, DOA work together and what’s their role within a system?

Most of my work is written in Java using Spring Boot. In a recent project my entities contained no business logic, Spring Data was used to handle repositories and I have service classes that ...
1
vote
0answers
50 views

Is separating a Spring Boot REST API into interface and implementation a good practice?

I "herited" a lot of Spring Boot code which is basically an asortment of REST Webservices. All those webservices are separated into an interface and an implementation and I find it hard get a grasp of ...
3
votes
1answer
1k views

How to deal with large data in Websocket message?

I wrote a websocket server in Spring Boot and a client in Javascript. These work fine. I also wrote a second client in Java. When this one attempts to handle a frame after connecting to the host, I ...
0
votes
1answer
159 views

Best approach for web service that calls other web services

The scenario is: client makes request to server A Server A makes potentially multiple requests to server B. Edit to clarify, server A makes the requests concurrently using Futures. Server A blocks ...
0
votes
1answer
40 views

Best way to handle environment specif fields in Hibernate

We have one microservice that will be deployed on two different environments(A and B). There are some common fields and also some are specific to the environment. Example: SomeEntity for environment ...
1
vote
1answer
144 views

Where to store static contents

Recently I am developing a new feature for my web application that must be Release Independent. The feature requires to show some predefined data. Those data will rarely be changed or updated. Here ...
1
vote
0answers
341 views

How to make rest api end points in swagger UI pre authenticated in Spring BOOT

I have written a spring boot rest API application with OAuth.I have integrated swagger UI for API documentation. I want the API endpoints on swagger UI to be accessible without an access token. Please ...
1
vote
3answers
641 views

HATEOAS APIs and front end development

We are developing a tool from scratch based on a Spring backend and VueJs frontend. I am primarily working on the backend and came to know about the HATEOAS principle of developing REST APIs and ...
1
vote
2answers
378 views

Returning JPA Entities in Rest Api's?

Recently Ive seen so many devs working with the stack Spring/JPA and returning all these JPA entities on their rest controllers. In my opinion it's a BAD PRACTICE for several reason such: ...
1
vote
2answers
435 views

Is it okay to put all your error handling on facade layer?

I am doing a Java Spring-Boot backend project and I am implementing a controller-facade-service pattern on my structure. So is it best to put all my error handling on the facade layer, while the ...
9
votes
1answer
13k views

What is the use of DTO instead of Entity?

I am working on RCP application, I'm new to this application. Spring beans are used to write business logic to save/fetch entities. But, instead of sending entities directly to client we are ...
1
vote
0answers
254 views

Putting the rowmapper inside the domain class

Normally in java the RowMapper is placed in its own class. Instead, what about this design, putting the RowMapper inside each domain object, and giving all of them a consistent name: public class ...
1
vote
0answers
340 views

Maven plugin to operate at parent and child module levels?

I have a large multi-module java/maven application where each child module is it's own java application and the root parent pom defines the standard dependencies pom.xml - parent pom - child1/pom.xml ...
3
votes
1answer
213 views

IEC 62304, Are Software Frameworks (Spring/JEE/Angular/React) considered SOUP?

Im working on the implementation of an IEC 62304 compliant development process in our company and I have a question considering SOUP (Software of unknown Provenance). Our goal is the develop a web ...
3
votes
3answers
291 views

Handling domain errors in the API

I'm working on building an API interface on-top of a domain-driven architecture. The domain layer has a bunch of specific exception classes (i.e. NameIsRequiredException, CannotPublishDraftException, ...
2
votes
2answers
225 views

How to correctly split a monolith and rely on the same domain

Context I'm developing a Spring Boot java application. Currently it is a monolith with the rest API and the front end (vaadin driven) in the same big project. Although this is very easy to develop ...
0
votes
0answers
2k views

Repository vs. DAO (again)

In general this back-story does not matter but just to explain the code below: The server handles users and user groups. User groups are able to "discover" places - at this point in time these places ...
0
votes
1answer
312 views

Given an implementation of a Service Layer and Repository layer, should you make tests of both?

Currently I have an entity called Product with the respective ProductRepository and ProductService. For ProductService, I have tests for: Read (Covering Create too) Update Delete Besides achieving ...
3
votes
1answer
6k views

Data Objects for each layer(DTO vs Entity vs Response objects)

Let's say I'm building a Customer web application(in Spring Boot 2), which also exposes rest end points. I'm modeling my application into 3 layers. a) UI - CustomerDTO b) REST - ...
0
votes
2answers
101 views

Spring application context - dependency chaos

I am new in a team working on a grown and complex Spring MVC application. The application context is widely wired using @Autowire annotated constructors. This seems to be the main reason for the issue ...
2
votes
1answer
187 views

What is the better place to create the Binding and Queue on RPC communication: Consumer or Producer?

I was talking with part of my team about the responsibility for who own the Binding and Queue creation. We are using Spring framework. In async communication they agree that the responsability to ...
0
votes
2answers
187 views

How to not leak the auditing information to the business layer

From a REST API, we write to the database. We want to store who was the person that triggered this change. We have this information at the controller layer. The saving happens at the repository layer (...