Skip to main content

Questions tagged [spring]

The Spring Framework provides a comprehensive programming and configuration model for modern Java-based enterprise applications - on any kind of deployment platform. A key element of Spring is infrastructural support at the application level: Spring focuses on the "plumbing" of enterprise applications so that teams can focus on application-level business logic, without unnecessary ties to specific deployment environments.

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

Java multithreading with Spring JPA

I have to improve a process that is currently sequential, and i wanna make it multi-thread. This process uses Spring JPA, with spring boot 2 and java 17. I would like to have a feedback on the ...
Fabio Piunti's user avatar
0 votes
0 answers
80 views

Securing microservices with Spring Security JWT

I would like to build a RESTful microservices architecture where each microservice acts as a resource server. Additionally, there will be an authorization server responsible only for user registration,...
yaroslav96's user avatar
4 votes
1 answer
67 views

Calculating a weight from a tag using kotlin

I'm not really happy with the below solution. Background is that I am receiving results from a graphql query that includes tags, and I want to translate these tags into weights and save those results ...
isic5's user avatar
  • 85
0 votes
0 answers
31 views

Spring Data JPA OneToMany relationship

I have an Web Application where I have to develop functionality like: I have Entities as: ...
Arshad Ali's user avatar
1 vote
1 answer
67 views

Rate limiting WebFilter

It's a simple WebFilter for limiting RPS from one of my projects. There's only one OOB BucketResolver that has one shared bucket ...
Sergey's user avatar
  • 561
2 votes
2 answers
515 views

Using java streams to handle incoming API requests

I am using the java stream API to handle incoming requests my employee service. A few questions I had are: Does using the streams API in the way I'm using it below affect the performance of the ...
Brandon Bryan's user avatar
0 votes
0 answers
39 views

ParamInitializer framework: automatic provision of expected request parameters by Spring Cloud Gateway

I continue to share portions of my Dynamic Gateway project This time, I want to publish the types relating to its "parameter initializing" functionality. The idea is simple: if my gateway ...
Sergey's user avatar
  • 561
0 votes
0 answers
43 views

Retrieving resources of JWT-authenticated user Spring Boot Java

I have a Java Spring Boot Rest-API which is authenticated using JWT-tokens. Currently the API only contains Users and CashflowCategories. An user can have many CashflowCategories. When the user makes ...
O'Niel's user avatar
  • 197
0 votes
0 answers
40 views

Scaffolding through my own language (Rapid Application Development)

I'm developing a webapp where some parts that repeat, so I made source code to generate source code. I had a lot of fun using Spring-Roo and Grails in the past but was sad that the difference between ...
Grim's user avatar
  • 612
2 votes
1 answer
49 views

Any possible issues with my approach to Access Management where I'm associating the list of Departments with the User class?

I have a spring boot project with JWT being used for Spring Security. I want to implement Access Management in my project and I'm using this approach. In my project, whenever a user is created, a list ...
Joe's user avatar
  • 23
4 votes
2 answers
89 views

Choosing Between Field Injections and Constructor Injections for Modular Java Applications with Spring Boot

I'm six months into a Java training program and have developed a Spring Boot application, adhering to Java's separation of concerns principle. I've organized my application with distinct sections for ...
Kerem Tazedal's user avatar
2 votes
2 answers
112 views

Simple authentication server

Here's a simple authentication server. It's pretty basic but has the core functionality of sign-up and log-in handling. Your best bet is to simply run the ...
Sergey's user avatar
  • 561
0 votes
1 answer
42 views

Spring Boot old versions of endpoint

I have 5 versions of some endpoint. Only V4 and V5 are used currently on the frontend side. What should I do with the V1, V2 and V3 versions? Should I remove them when are not used anywhere? ...
Matley's user avatar
  • 133
1 vote
0 answers
82 views

Flexible AuthenticationExtractionWebFilter

I decided to share with you a portion of my gateway project. It's an authentication extraction filter that extracts authentication claims without being coupled to any specific authentication mechanism....
Sergey's user avatar
  • 561
1 vote
1 answer
141 views

Spring Batch Item Writer Calling Stored Procedure

While migrating a Spring application to Spring Batch, I encountered a scenario where I need to process chunks of records from the database and invoke a stored procedure for each chunk. However, each ...
Vasanth's user avatar
  • 173
1 vote
1 answer
369 views

Inserting large number of rows into database with Spring boot

I need to insert many million rows + many GB of data into a database for a project that uses Spring boot. I recreated a minimal example with a one to many relationship and am trying to find the ...
Pux's user avatar
  • 155
4 votes
1 answer
100 views

FastAPI Class based Design

I am new to the FastApi world. Can somebody review my below Fast API design? It is working but doesn't follow ...
garg10may's user avatar
  • 244
0 votes
2 answers
51 views

How to find a more effective way to load a file and compare in the service

I have a malware detection system that includes a subsystem responsible for IBAN checks. Initially, this subsystem needs to load and parse data from a specific URL. Subsequently, it checks whether the ...
Nesly's user avatar
  • 17
1 vote
0 answers
37 views

Websocket code to be improved

This is the plain websocket code that connects with mobile app. Once we send a REST request from another service say B to our service A we send a websocket payload over the response. This runs in ...
darthwader's user avatar
1 vote
0 answers
70 views

Todo application using Spring Boot 3, Dockerized Postgres, Java 17, Maven

I'd like to have code review for backend of todo app. It has 2 main functionalities: Authentication and authorization using Spring Security and JWT token. CRUD for tasks In particular I'd like to ...
J.Olufsen's user avatar
  • 161
1 vote
1 answer
324 views

About self validated Java POJOs

I am currently experimenting with self validating Java beans in order to avoid the creation of objects with invalid states, while keeping the validation knowledge inside the bean. The goals I have in ...
silver_mx's user avatar
  • 119
2 votes
2 answers
67 views

Spring Boot REST API for moving toy robot in 5*5 grid [closed]

I have designed and coded REST APIs to move the toy robot in 5*5 grid. Please let me know any feedback on improvements, etc Complete Code here: https://github.com/pkkht/RobotRESTApp ...
Hariharan's user avatar
1 vote
1 answer
494 views

Spring Boot Azure Service Bus Listener

I would greatly appreciate your feedback and review of our Spring Boot Azure Service Bus listener implementation. Your insights and suggestions will help us ensure its efficiency and reliability. ...
Siyamcela Nxuseka's user avatar
2 votes
1 answer
392 views

blog RESTFUL api with posts and comments

I built RESTFUL api for a blog using java and spring boot(without a frontend). What it does the code manages all the http methods on a post inside the blog and comments on that post. the post consists ...
Ellie's user avatar
  • 549
0 votes
1 answer
220 views

is my code protected against SQL injections?

im using spring boot and CrudRepository for my queries, the project is about posting content on a blog, so I have a post record with id, creator name, post name, the content itself likes and dislikes: ...
Ellie's user avatar
  • 549
2 votes
1 answer
158 views

Spring security configuration

I am new to spring boot and wanted to make a simple application with JWT authentication. There is one problem with the response having 401 status when it should have 403 but otherwise everything seems ...
Newbee's user avatar
  • 43
1 vote
1 answer
78 views

Rest API design with Spring Boot

In a recruitment interview I got this small projet to do at home: rest API written in Java using Spring Boot. As I didn't hear back from the company I wanted to have feedback from review. I am a rest ...
Dimitar Angelov's user avatar
1 vote
1 answer
64 views

Code to save account details and register based on payload

I have this flow for registering a user. They send an empty user account no to get a temp account no which then they use for verifying the OTP by email and phone. Both done they should register ...
rest_easy's user avatar
0 votes
2 answers
58 views

Naming of api calling methods to get an object by two different properties

I have the situation, where I have to methods in my api calling class that do basically the same thing. I have a profile that contains multiple account objects. These objects have their own UUID as a ...
monamona's user avatar
  • 475
0 votes
1 answer
205 views

Spring Boot Account API with React Frontend and Identicon Integration

I have recently been exploring React and Spring Boot, and I would greatly appreciate your feedback on a practice application that I have developed. The application consists of a Spring Boot backend ...
thebluepandabear's user avatar
1 vote
2 answers
178 views

Search/Query API cross parameter check

Background I was working on a coding challenge as part of an interview process. I had to create a REST API where the user can report sensor data and query derived metrics based on several filter ...
Peter Csala's user avatar
  • 9,363
4 votes
1 answer
108 views

Spring REST Endpoint for Saving a User Inquiry

Here's a piece of code from codebase I maintain/contribute to. It is a Spring REST controller, which exposes an endpoint to create user question. The question consists of title, description and ...
Sergey's user avatar
  • 561
2 votes
0 answers
167 views

Java Project Reactor/WebFlux token service

I'm trying to achieve a thread-safe reactive token service. The point is that all subscribers must wait until the token is received or updated (when expired). It works, but I want a second opinion ...
John Goode's user avatar
0 votes
1 answer
140 views

Code that checks whether there is a holiday by calling another microservice

I call another microservice to check whether there is any holiday on any particular day. This will then add a comment in the db if the rest call doesn't fetch an empty list(a list of size 1). Here is ...
diaop's user avatar
  • 9
0 votes
1 answer
434 views

Assert MockMvc response by using Kotlin DSL

I build web application using Kotlin and Spring Boot, I use MockMvc to write integration test. I'm not satisfied how assertion looks like, here is typical assertion: ...
Mateusz's user avatar
  • 113
3 votes
2 answers
125 views

Spring boot shop application with error handling

I'm writing a simple online shop using spring boot, for learning purposes. Right now I have purchasing-service and a product-service. The purchasing-service makes requests to the product-service via ...
Eoin's user avatar
  • 263
2 votes
2 answers
173 views

Duplicate code in spring controllers

...
user9132502's user avatar
0 votes
2 answers
97 views

Java spring controller method to trigger e-mail verification procedure [closed]

For readability sake, is it better to use optionals or write my code in an iterative manner? Here's a route I'm working on, does this look readable do you? ...
user9132502's user avatar
4 votes
0 answers
3k views

Reactive JWT authentication using Spring webflux

Greeting to all senior devs here. I'm trying to create a project for my small business. There are not many tutorial on how to create Reactive JWT authentication with Spring webflux. So I'm a bit ...
Patrick's user avatar
  • 331
1 vote
1 answer
76 views

Read from dynamic source and caching

I want to load JSON data from a link at the beginning of an application. I need to be a little bit about clear the following code. And also want to ask about another opinions that what could be the ...
Neslihan Bozer's user avatar
1 vote
1 answer
2k views

Collect and combine results of async calls returning completable futures in Java in a cleaner way?

I need an abstract way to implement this below functionality because in my code I have to use it in multiple places with different REST endpoints. If I ignore it will cause code duplication. Please ...
tomsheldon's user avatar
1 vote
0 answers
1k views

Spring Boot Integration Test with SQS and Elastic Search

I have the following integration test that starts with sending message to sqs queue and ends with checking elastic search if the associated object added to db. The part of application I want to test ...
Davis's user avatar
  • 53
1 vote
2 answers
1k views

Using Factory Design Pattern in Rest Controller of Spring

I used factory design pattern to identify the service according to the enum that comes from the api uri as request param. Everything seems okay according to me but cannot be sure if I used it right. <...
Abdu Muhammadal's user avatar
-1 votes
1 answer
79 views

Using Factory Design Pattern in Spring [closed]

I organized the factory design pattern but I'm not sure if I used it right or wrong. Here's my data model; ...
Abdu Muhammadal's user avatar
3 votes
1 answer
92 views

A controller for a Game Service

I have a Spring MVC controller but I'm not sure that it is a good or bad design. As far as I know, api versioning is missing but apart from that I implemented Swagger for documentation and added ...
Burak's user avatar
  • 31
3 votes
2 answers
100 views

Search code that performs in-memory search

This is the code I came across in our repository. This performs search in-memory and is invoked on service layer code. In our front end operators like EQUAL_TO and ...
user251118's user avatar
1 vote
1 answer
92 views

Cleaning Kotlin method which returns the document name after the id

I'm just getting to know the possibilities of Kotlin and mongoDB. I am writing a method that returns the name of the street after the ID. Everything works, but I find it quite sloppy. Empty String ...
AdamK's user avatar
  • 35
1 vote
1 answer
3k views

Spring boot: better way to handle response and exceptions

I am working on a quite a big Spring Boot web service and I wanted a standardized and simplified way to handle responses and exceptions by following fluent API design. So this is what I did and it ...
benjamin c's user avatar
1 vote
1 answer
93 views

Refactoring duplicated code with abstraction and generics

I have written simple command line project with Spring. And from what I think quality of code is pretty poor. I see what I could improve to remove duplicated code, but somehow I have no idea what ...
Suule's user avatar
  • 85
2 votes
1 answer
544 views

Simple game of Chutes and Ladders

I recently made a new project for Chutes and Ladders (the Hasbro version of Snakes and ladders) and it is located here: https://github.com/vchittar/ChutesAndLadders BoardLogic (implements an interface)...
smarty_pants's user avatar

1
2 3 4 5