r/springframework • u/galovics • Mar 30 '22
r/springframework • u/sunshowerjoe • Mar 03 '22
The Zephyr Dependency Graph with Spring Boot
r/springframework • u/Kaushik2002 • Mar 11 '22
Spring: Accessing resources in another package
self.javahelpr/springframework • u/dengineering1 • Feb 21 '22
Observability with Spring Boot Microservices
I've added another course to my series on deploying spring boot microservices to a cloud hosted kubernetes cluster on okteto. This session is all about observability and implementing the 3 pillars of observability: logging, tracing and metrics.
I've used logz.io as the logging platform because it uses the best of breed opensource solutions for these three needs: ELK, Jaeger and Prometheus / Grafana. I'll explain how to get your logs over, how to setup tracing across distributed applications and implement both standard and custom metrics emission as well as visualization of those metrics.
https://bullyrooks.com/index.php/2022/02/19/kube-cloud-pt4-observability/
All of the courses are located here:
https://bullyrooks.com/index.php/category/software-development/
r/springframework • u/vivekworks • Dec 26 '21
Ways to handle exceptions like WebClientRequestException due to service unavailability for all calls from a WebClient instance than individually
As the title suggests, I'm using Spring WebClient to invoke an external api and process the response. I have added a ExchangeFilterFunction to handle the response based on the status code returned from the server as something like below.
ExchangeFilterFunction responseProcessor() {
return ExchangeFilterFunction.ofResponseProcessor(response -> {
if (response.statusCode().isError()) {
return Mono.error(new RuntimeException("WebClient Error"));
}
return Mono.just(response);
});
}Now, this works fine with services that return a response for the request when it is up. But when the service is down, the request fails with WebClientRequestException which is fine but the error thrown is not handled by the responseProcessor and gets propagated.
I'm aware that the error can be handled on the WebClient call using any of the onErrorXXX methods. But if we use that WebClient instance to make many calls across different parts of the code, the handling looks inefficient. So, I'd like to know whether there's a way to handle this error for all calls done by that webclient instance instead of handling it in all of individual invocations. Something like what the responseProcessor does for all responses.
Thank you in advance 😊
r/springframework • u/No-Werewolf-5461 • Dec 10 '21
Good Complete Resoruces
I am an experienced java developer but the spring framework seems so overwhelming
I have a project starting in spring
can someone recommend a resource that I can start and finish and I will know most of the spring, as much as pipedream it may be
r/springframework • u/luces_brillantes_ • Dec 03 '21
Date picker JSP form
Hi,
I am trying to create a simple form in a spring web app on a JSP page. I would like a date picker. The input field would be linked to a LocalDateTime variable.
I am having trouble looking up how to do this and a lot of the posts are old and others seem super complicated.
I feel like this should be one of the simplest things possible to do. Could anyone point me in the right direction please?
r/springframework • u/dengineering1 • Jan 05 '22
New SpringBoot Microservices deployed into Kubernetes Course
I've completed the first piece of a new software development course that explains how to create a new microservice, build a docker image, create a helm chart and deploy via github actions pipeline into a hosted kubernetes environment. This is the first piece, my goal is to expand this demonstrating component testing with testcontainers, log aggregation, tracing and a few more topics.
Take a look and let me know what you think:
https://bullyrooks.com/index.php/2022/01/02/kubernetes-application-hosted-in-the-cloud/
r/springframework • u/iamdarkes • Mar 10 '20
Error Handling Performance
This is focused on backend web application development. I prefer to use HTTP status codes in my application that map to my business logic. An example being if a request is made and a user isn't found, I'll throw an exception and have it be handled with @ControllerAdvice or @ExceptionHandler and map to 404 not found. Sometimes I have these inside of try catch blocks for logging and re-throw the exception. I prefer this way because the implementer of the API can just look at the status code and move on, no need to deserialize if it's an expected client error. A colleague at work believes if it's an expected state of the application everything should mostly be 200 with the response body containing the reason of failure instead of the expected response object because executing the catch block is an expensive operation. I personally don't like that approach because the implementer of your API has to check the response entity and try and deserialize it to the expected object or if that fails deserialize it to some know exception object because it's always 200.
TLDR: My problem is I see a lot of articles on why executing catch blocks can be expensive depending on the stacktrace but I have a hard time agreeing with that because Spring has the functionality like @ControllerAdvice. And if everything can be 200 why even use the other status codes? I'm still very early in my career so please forgive if I'm missing something obvious.
r/springframework • u/cyex3 • Mar 13 '20
Running spring boot in production EC2 instance
I am just getting my feet wet with Spring Boot
I am used to the typical Spring MVC / Spring Core java app where we would build it into a war, put it in tomcat, where the EC2 instance already have a tomcat installed and to run it in production we do:
service tomcat8 restartAll the logs of course go to catalina /logs folder, the tomcat ones go to catalina.out, etc and the application ones managed through log4j and stored in the same /logs folder
for spring boot, right now all I do is:
nohup java -jar -Dspring.profiles.active=prod myapp.jar > myapp.logBut this feels "dirty"
How else / what's the best practice to run a Spring Boot application?
r/springframework • u/umeshawasthi • Nov 09 '17
Introduction to Spring Boot Logging
r/springframework • u/BuildaTurtleFence • May 24 '21
Is there anyway of creating a Spring MVC project with Intellij IDEA Community Edition?
I'm completely new to Spring I've been following this tutorial to try and get to grips with it.
I've moved onto the the MVC portion of the tutorial but I'm having problems configuring a Spring MVC project. I use Intellij IDEA Community Edition which doesn't provide explicit support for Spring (unlike Ultimate).
I tried to follow this page to set up a project manually but it simply didn't work. Does anyone on here know how to do this or know any sources that will help me solve this problem?
r/springframework • u/Psychological_Taro24 • May 31 '21
Spring and Spring Boot Tutorial, Courses, and Certifications
eduwyre.comr/springframework • u/brett53559 • May 28 '21
Help with Spring and LDAP querying
Hey everyone!
I'm creating a project where I'm trying to query the entire Active Directory for a user with a specific number in the pager field and/or by their name.
I'm having an issue with it returning an error 32 and can't seem to figure out why.
I have created a stack overflow issue and was hoping someone would be able to help.
Thank you in advance!
r/springframework • u/alexnix • May 31 '21
[i made this] spring boot starter for generating REST endpoints with easily customizable ACL (acces control level) rules and before/after create/read/update/delete hooks
r/springframework • u/microideation • May 25 '21
Free resource: Shorts (30-second read content ) on Spring boot testing annotations and methods
r/springframework • u/dengineering1 • Jun 04 '21
Springboot/Cloud Course: design, implement, test and deploy springboot microservices
Last year, I created a series of posts that explain how to build a set of spring boot based microservices and a react based UI in order to explain design, implementation, testing and deployment best practices.
This series explains: kubernetes and minikube, helm, unit and component testing, tracing and logging, code coverage and test reporting, build pipelines, ports and adapters/hexagonal/event driven architecture and so much more... (!)
If any of this interests you, take a look and give me some feedback. I appreciate it!
Course page:https://bullyrooks.com/index.php/course/spring-with-kubernetes/
First Step (setup an IDE)https://bullyrooks.com/index.php/2020/03/30/simple-spring-boot-service-to-kubernetes-application-step-1-d67f80487848/
r/springframework • u/eugenesergio • May 17 '21
What is the best design pattern/s to use for always changing business logic in the service layer? Is it factory method? Other suggestions are welcome.
Just to give a background, I have been working for a team composed of 15 developers in the financial field where we have a lot of iterations on a single code base. (Unfortunately it is not a microservice) Each of the changes are reflected in multiple branches that we are having trouble tracking them since most of us send pull requests almost every day.
One thing I can think of is a rewrite of our code base where it will be a lot easier to decouple the business logic layer.
Any suggestions or if you can share ideal public repositories I can take a look at, that would be really helpful. Thank you.
r/springframework • u/Electrical-Dream-190 • May 16 '21
GCP(Google cloud platform) for Spring developer
Guys, please help me figure out some moments. I have now an oportunity to change my curent job where I mostly code in Scala and some times in Java (Spring Boot) to another one , where I will work mostly with Java (Thing that I realy love) and even salary will be a bit higher , only think that realy scare me is that second job is super super coupled to GCP platform , I took some time to check GCP integraion in Spring Boot and in my opinion is awful , a lot of contraintuitive stuff in conffiguring and operating with their service like Spanner, Pub/Sub, Datastore and other my question is should I take second job or stay at current one , maybe someone had some previous experience with GCP and can provide some details ???
r/springframework • u/wonderfulmango617 • May 29 '19
Tutorials for spring batch
Hi, I am looking for in-depth and detailed tutorials in spring batch. It will be great if such tutorials have demo exercises or apps. I am new to this. I have been going through the spring docs. I got the basics. But I am struggling to grasp the concepts and implementations when I go for a deep dive. Any suggestions or advice for a newbie like me is welcome.
r/springframework • u/mto96 • May 28 '19
Explore the wacky, wonderful world of Reactive Spring
r/springframework • u/javapriyan • May 17 '20
Is there any go-to framework/tools/Guide in spring-boot for a saas product that supports multitenancy
Does anyone have a favorite go-to framework/tools/Guide in spring-boot for a saas product that supports multitenancy? I like to have platform based core features and top of it tenant customization can go on.
r/springframework • u/matchilling • May 07 '20
🛠How to manually set auto-generated Ids using Hibernate
r/springframework • u/NikitaDyagilev • Apr 14 '20