r/SpringBoot • u/Willing-Star8001 • Dec 31 '25
r/SpringBoot • u/dotceng • Dec 30 '25
Question How can I handle file uploads in a microservice?
I’m developing an e-commerce microservice project with spring cloud. I want users to can upload files. So I created a service called file service. Actually I’m asking how to design data flow?
For example;
User wants to upload a profile photo. At this point, the main question is whether the upload request should go through the User Service or be sent directly to the File Service. If the request goes directly to the File Service, how should the profile picture information be stored and linked to the user record in the User Service database?
r/SpringBoot • u/External-Double6687 • Dec 30 '25
Question Short on Time and Money as a College Student, Need Guidance to Reach and Finish Spring Boot Quickly.
I need to learn Java Spring Boot in less than 4 weeks and somehow land an internship after that. Normally, I do not believe in rushed learning, but due to my current financial situation, I do not really have that luxury. I am still a student and I genuinely do not want to put more pressure on my parents for my expenses, so I am trying to be as practical as possible.
So far, I have already learned HTML, CSS, JavaScript (yeah yeah, average Joe Harry type stuff), Node.js, and I recently finished Express.js. My main goal is to learn backend development using Java Spring Boot.
I need help on the following points:
- What are the bare minimum additional tech stacks or concepts I should learn so that I can comfortably start learning Java Spring Boot?
- Any YouTube channel, playlist, or Udemy course you would strongly recommend for Spring Boot.
- Any other advice you would like to give, since I am still a student and a lot junior to you
Thanks in advance.
r/SpringBoot • u/Tony_salinas04 • Dec 30 '25
Question What is the most professional way to create a logging system in Spring Boot?
Estoy haciendo un e-commerce para mi portafolio y tengo el siguiente código.
public Product getProductEntityById(Long productId) throws NotFoundException {
return productRepo
.findById(productId)
.orElseThrow(() -> new NotFoundException("No se ha podido encontrar el producto"));
}
@Transactional
public ProductDetailsDTO createProduct(CreateProductDTO dto)
throws AlreadyExistsException,
InvalidRequestException,
DatabaseErrorException,
NotFoundException {
if (productRepo.getByName(dto.getName()).isPresent()) {
throw new AlreadyExistsException("Ya existe un producto con ese nombre");
}
Product newProduct = productMapper.createProductDTOToEntity(dto);
Category category = categoryService.getCategoryEntityById(dto.getCategoryId());
newProduct.setCategory(category);
try {
productRepo.saveAndFlush(newProduct);
logger.info("Guardado el producto con id={}", newProduct.getId());
} catch (PersistenceException ex) {
logger.error(
"No se ha podido guardar el producto de nombre {}, Error: {}",
newProduct.getName(),
ex);
throw new DatabaseErrorException("Error en la base de datos");
}
return productMapper.productToDetailsDTO(newProduct);
}
El problema es que es llamar tantas veces a logger crea un método difícil de entender y además difícil de mantener y acoplado. Ya que también me gustaría añadir algún warn o debug, además tendría que repetir algo como esto en cada servicio. Había pensado en usar AOP y estoy aprendiendo pero no se si es la mejor opción. Qué me recomiendan?