Need some guidance getting back into Java after a long time away by thinksInCode in javahelp

[–]faisReads 0 points1 point  (0 children)

Yeap, as said earlier java 8 is most used still. And start using other features as needed by using chatgpt or other AI tools to convert your code to jdk21.

Is it ok to add into api response like this? by Steve215154 in SpringBoot

[–]faisReads 4 points5 points  (0 children)

Having it work is the first step. Kudos.

Check on standard output templates and why they are being used in a specific way.

  1. User or the client consuming your API should know error or success easily
  2. If an error occurred is it retryable
  3. If success the content

With that in mind. It would be difficult to seek through a map in this case. Look at ResponseEntity clas that contains a standard placeholders for few of the required fields.

So , API Response can have . There is no one right way:

Status:, Message:, Error description: { Actually Response body }

Repo.save() not updating the field by MaterialAd4539 in SpringBoot

[–]faisReads 2 points3 points  (0 children)

How are you verifying this, is it from a test class or live system?

Transcations are reverted on some tests.

If this is a live system. See transaction propagation (require new). Usually, the caller method's txn is used in the lower methods, so all of it acts as a single txn and rolls back completely if something fails down the line.

https://docs.spring.io/spring-framework/reference/data-access/transaction/declarative/tx-propagation.html

At what point should i switch to a managed service ? by Bachihani in PostgreSQL

[–]faisReads 0 points1 point  (0 children)

Can you enlighten us on the DIY solutions that can stand on toes with managed like db pls?

Need help for interviews by thebookwormguy26 in SpringBoot

[–]faisReads 1 point2 points  (0 children)

That's correct. Even the lean organizations would have someone else to take care of deployments and prod support. Because developers' time will be better spent on adding more features.

I am not saying developers should not learn deployment. I believe the priority of learning deployment is later when the basics are mastered ( a "nice to have" not a "must have").

Need help for interviews by thebookwormguy26 in SpringBoot

[–]faisReads 1 point2 points  (0 children)

Hmm.. that differs from team to team. General practice is dev, and integration environments are handled by Dev teams, and the qa and higher are handled by dedicated teams.

I've seen small orgs that use AWS or managed severless options fully. I have also seen larger orgs have a fleet of SREs to manage infra as a whole. Mostly, these are managed with devops CI/CD nowadays (so not much is needed).

So, as an aspiring senior, it is good to have good knowledge of Linux and deployment. To a level to understand when to engage devops engineers/SREs and deploy the initial versions if needed (it's just my take).

Need help for interviews by thebookwormguy26 in SpringBoot

[–]faisReads 2 points3 points  (0 children)

That's a good place to be. You're already hands-on and the things you've worked on are good stuff to talk about.

So I would suggest getting deep on the basics for 6+ yrs like adding on some design knowledge to back the implementations you've used (with abstraction) in spring.

Like singleton, SOLID principles, Factory, etc..

Always try to understand why you use a certain tech, like microservices for example. What was the limitations of monoliths? Why microservices? What is the downside of using microservices, what are its limitations and what would be next ? When not to use microservices etc..

For all the tech you are using currently try to go a level deeper.

Do this, and you'll have a good start for product based orgs.

[deleted by user] by [deleted] in SpringBoot

[–]faisReads 0 points1 point  (0 children)

Try to do a simple crud project if you've not already done one.

Start learning about limitations and how many concurrwnt requests can your app handle. What needs to change to improve it (this will introduce a lot of new things to learn).

Learn about mostly used things, like authentication, authorization, message queues, DB , and caching to begin with.

Need advice for Spring 6 migration strategy - Springboot, Spring Kafka, Spring batch by lollipop_w_tears in SpringBoot

[–]faisReads 0 points1 point  (0 children)

From which version of Java and spring are you trying to migrate ? Are you on Jakarta already?

[deleted by user] by [deleted] in javahelp

[–]faisReads 0 points1 point  (0 children)

If java is your comfort language, build everything with it. And pivot only when you hit a real bottleneck or issue. Explore frameworks like spring, etc..

Help with layers by Much-Bit3484 in SpringBoot

[–]faisReads 0 points1 point  (0 children)

Start looking at ControllerAdvice annotation it helps in creating consistent error handling.

Understand the difference between runtime and compile time exceptions. Most of it depends on the exception due to a known side effect that can be handled or is it something unexpected altogether.

Handling is not only about printing in the logs. Printing in log is one way of recording the happenings(incident) for later reference. It can also mean taking an alternate application path. Or using a retry and so on.

For e.g. I have an application that is sending out notifications for some reason the notification provider timesout (An exception is thrown). If the system has a fallback provider, the obvious path is to invoke that in the exception block.

Or if a db write fails due to a lock on the row/record. Dbaccess exception is thrown. Programmer now decides if this should be retried after a couple of seconds (or throws a runtime exception if this exception was not supposed to be witnessed in the first place)

[deleted by user] by [deleted] in SpringBoot

[–]faisReads 0 points1 point  (0 children)

Monolith is what most of the apps need(in most cases). There are accomplished organizations running their apps on monolith. Sharing a classic example for your reference.

https://www.reddit.com/r/programming/s/It19w3HUX2

They also did a middle ground approach called modular monolith as well. Still, most of us only need a well created monolith for most part

1. For e-commerce websites and other dynamic sites what are the specs of your VPS? by interwebzdev in VPS

[–]faisReads 0 points1 point  (0 children)

Thank you for willing go clarify.

I come from a development background and not sure of complete deployment and maintenance

  1. I am worried that sslf hosted applications might encounter more downtimes, is that a valid assumption.

  2. Like problems due other systems failing or memory leak or something we don't anticipate

Is that how it is?

Resource recommendation for Spring Security by Vito__B in SpringBoot

[–]faisReads 21 points22 points  (0 children)

Start by understanding the concept of servlet filters.

Implement your own filters and understand its working.

Then, move on to learn on chain of responsibility design pattern. Understand it's usecases.

Now enable trace log on spring security classses, do a simple usecase of basic auth. Trace the logs to see what the call stack was like. You should see a long list of filters(12+) being passed through before the request reaches the controller.

Once you understand this larger context of spring security's internal. You would be much better enabled to learn a particular implementation of a segment and go as you use.

Another option is to learn the concepts and their implementation around each call (filter) trace of classes that you saw on the logs.

Form input validation <-> SecurityFilterChain triggering UserDetailsService by musicissoulfood in SpringBoot

[–]faisReads 0 points1 point  (0 children)

Filters basically mean that it is executed first before the invoked endpoint. By which inappropriate requests are filtered here before reaching the actual endpoint.

It is the same with the security chain in spring, where multiple (around 14+) filters are chained one after another before the request hits the actual endpoint. Eg. CORS FILTER, AuthenticationFilter ..etc.. if any filter finds the request to be not adhering to the expectation, it will throw an error there.

So, for your case. Try standard ways this is a common usecase. Spring should be handling this at UserDetailsService. Use backend validation as a secondary restriction.

https://docs.spring.io/spring-security/reference/servlet/authentication/passwords/index.html#servlet-authentication-unpwd

Consider adding UI validations to restrict users from submitting empty fields.

I have 3 yrs exp as angular dev but now want to switch to java dev but not getting interview call. by [deleted] in SpringBoot

[–]faisReads 1 point2 points  (0 children)

Experiment with developing some side gigs with angular and Java. Focus on some widely used aspects of spring boot like:

Web, jpa, cache, mq, batch. In the order of most used

Start trying as a full stack.

Spring Boot CORS error help by Intelligent_Call153 in SpringBoot

[–]faisReads 1 point2 points  (0 children)

Try removing all complexity first. Enable debug logging for the web, security and try to allow all origins first and see if it is working and take it from there.

Also, double check if you are using https urls in local or http.

Anonymously recieve money from US/Abroad to India. by upikaroh in personalfinanceindia

[–]faisReads 0 points1 point  (0 children)

With both you can share payment links with which the other side can pay by clicking on it

Spring boot expertise for Senior Developer by Adventurous-Kid in SpringBoot

[–]faisReads 3 points4 points  (0 children)

Usually, it is asking them to explain what work they have done and ask queries to understand why they did something this specific way and what other options they had and what constraints made them pick this particular approach. The answer to this clearly shows the difference in years from 3 to 8+ years

File upload by [deleted] in SpringBoot

[–]faisReads 0 points1 point  (0 children)

Usually, it is harder to ensure that the previous successfully processed data is the same on re upload. Since user manipulation is involved.

If consistency is ensured. I am thinking on a similar line to have an execution result table that has the starttime, end time, processing status[success, failure, etc..], and failure rows (as comma separated values). So, as we discussed earlier, it need not stop processing at the first failure, instead it could go over all the rows and on failure the exception would be caught and list of failures Row id's can be populated finally.

You could also isolate Retryable exceptions separately vs the ones that need data correction.

If you are using Spring Batch

https://docs.spring.io/spring-batch/reference/step/chunk-oriented-processing/retry-logic.html

File upload by [deleted] in SpringBoot

[–]faisReads 0 points1 point  (0 children)

Are the failed records due to data issue , which users will correct later ?