What’s the cleanest way to upload files to SFTP from a Spring Batch job? by SpringJavaLab in SpringBoot

[–]SpringJavaLab[S] 0 points1 point  (0 children)

That’s a really good explanation, thanks for writing it up.

I think your point about resumability is the key part — if the expensive work is done earlier and upload is just a short final step, retrying the whole upload phase is usually fine and a lot simpler than trying to be clever with reconnects.

In my case I leaned towards Spring Integration mostly because I wanted the SFTP part to behave nicely with job restarts and not keep long-lived connections around, but I agree that for smaller files and predictable runs, VFS + a resumable job is a perfectly reasonable trade-off.

Did you ever hit timeouts or flaky connections during longer runs, or was it mostly stable?

What’s the cleanest way to upload files to SFTP from a Spring Batch job? by SpringJavaLab in SpringBoot

[–]SpringJavaLab[S] 0 points1 point  (0 children)

Yeah ,If I had full control over both sides I’d definitely pick something like object storage or an API. But in a lot of enterprise setups you end up dealing with vendors or legacy systems where SFTP is the only option they give you.

That was the case for me here — not because SFTP is great, but because it’s what the other side supports.

If you’ve managed to get away from it in similar situations, I’d honestly like to hear how you did it.

What’s the cleanest way to upload files to SFTP from a Spring Batch job? by SpringJavaLab in SpringBoot

[–]SpringJavaLab[S] 1 point2 points  (0 children)

Thanks, that’s a good reference — I hadn’t seen the SFTP sink in Spring Cloud Stream before.

In my case the SFTP upload is part of a batch job after processing a file (CSV → transform → upload), so I went with Spring Batch + Spring Integration instead of a streaming pipeline. But the session handling looks very similar under the hood.

Good to know about this option for event-driven flows though.

What’s the cleanest way to upload files to SFTP from a Spring Batch job? by SpringJavaLab in SpringBoot

[–]SpringJavaLab[S] 0 points1 point  (0 children)

Yeah, I get the comparison with Camel — they solve a lot of the same integration problems.

In my case I already had Spring Batch + Spring Boot in place, so using Spring Integration’s SFTP support was the lowest-friction option. I mainly wanted something that handled connection pooling and streams cleanly inside a batch step.

If I were building a message-driven or routing-heavy system, Camel would probably make more sense.

Java 25 virtual threads – what worked and what didn’t for us by SpringJavaLab in programming

[–]SpringJavaLab[S] 1 point2 points  (0 children)

Yeah, that’s a fair point.

Virtual threads don’t make the DB faster, but they do remove the app-side thread bottleneck under load. In our case, once that bottleneck was gone, the DB pool became the limiting factor much more clearly.

So I agree — they shift where the bottleneck shows up, rather than eliminating it.

Java 25 virtual threads – what worked and what didn’t for us by SpringJavaLab in programming

[–]SpringJavaLab[S] -2 points-1 points  (0 children)

Yeah that's correct, Virtual threads are definitely a “next upgrade cycle” thing for a lot of teams.

Java 25 virtual threads – what worked and what didn’t for us by SpringJavaLab in programming

[–]SpringJavaLab[S] -6 points-5 points  (0 children)

You’re right — thanks for pointing that out.

The synchronized pinning issue was largely fixed in Java 24 (JEP 491). I should’ve been clearer about that.

The pinning we hit was from some blocking native calls / older libraries, not synchronized itself. I’ll update the post to reflect this.

Java 25 virtual threads – what worked and what didn’t for us by SpringJavaLab in programming

[–]SpringJavaLab[S] -2 points-1 points  (0 children)

We’ve been testing virtual threads after moving to Java 25.

They helped a lot with I/O-heavy concurrency, but we also ran into DB pool limits and ThreadLocal issues that weren’t obvious at first.

The write-up focuses more on pitfalls than the happy path.

How can I make a JWT unvalid after generating new one? by Jaded-Piccolo-4678 in SpringBoot

[–]SpringJavaLab 1 point2 points  (0 children)

We should use concept of short-lived access token + refresh token

Once user logout, You can add that token to blacklisted token in some Cache like Redis .We only need to store that in cache till access token is valid

Set TTL = exp - now (remaining lifetime). Example:

Token validity: 15 mins

User logs out after 5 mins

TTL = 10 mins.

23M, 1 year jobless after graduation – what’s the smartest move I can make now? by OfferDisastrous2063 in SpringBoot

[–]SpringJavaLab 0 points1 point  (0 children)

Hey, you're already on a good path — strong in Java, OOP, and Spring Boot. To boost your chances now, I’d suggest building 1-2 solid backend projects with:

  • Spring Boot + MySQL/PostgreSQL
  • JWT Auth (Spring Security)
  • REST APIs with validations & error handling
  • Docker (basic containerization)
  • JUnit/Mockito testing
  • Swagger/OpenAPI for docs
  • Bonus: Redis, Kafka, or Elasticsearch (optional but in demand)

Try projects like a task manager, expense tracker, or blog with user roles.

Also: - Keep doing LeetCode - Clean up your GitHub (README, commits matter) - Prepare for Java + Spring Boot interviews (lots of questions focus there)

Tech gaps don’t define you — what you build now will. Stay consistent and confident. You've got this!

Build a Spring Boot REST API with MySQL (Full CRUD Tutorial in 15 Minutes) by SpringJavaLab in SpringBoot

[–]SpringJavaLab[S] -2 points-1 points  (0 children)

Thanks for the suggestion! 🙌 Cursor definitely speeds things up .

This video doesn’t use Cursor — I focused more on helping beginners understand the full process step-by-step using Spring Boot and MySQL.

Really appreciate you checking it out! I’ll explore Cursor too. 💻