SShortSingh.
Back to feed

Spring Boot DeferredResult: Handling Async Timeouts and Errors

0
·5 views

This tutorial explains how to use Spring Boot's DeferredResult to handle asynchronous requests without holding servlet threads. It covers creating a DeferredResult with a timeout value and registering callbacks for timeout, completion, and error events. The article includes a complete controller example where long-running tasks run on an executor service and set the result when finished. It also demonstrates error handling, including returning error responses with appropriate HTTP status codes.

Read the full story at DEV Community

This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)

Log in to join the discussion and vote.

Log in

Related stories

0
ProgrammingDEV Community ·

Transparent WebM Turned Opaque in Pipeline With No Error, Developer Finds

A developer found that an 8-second VP9 WebM with an alpha channel, exported from a local browser-based video background removal tool, became fully opaque during conversion without any step reporting an error. Using FFmpeg 7.1, they found that the default VP9 decoder read the alpha plane as entirely opaque, while the libvpx-vp9 decoder showed roughly 79% of frame 60's pixels as transparent. File sizes differed between decoders, but size alone was not treated as proof of correctness. To locate the faulty stage, they built three checks: a container probe that counts alpha data rather than trusting the alpha_mode tag, a decode probe that pins the decoder and reads a fixed frame, and an output probe run after every conversion. The article reports these checks and their results on the test files, but the testing was limited to one clip and one FFmpeg build.

0
ProgrammingDEV Community ·

Why Slow Websites Lose Visitors and How to Speed Them Up

Slow-loading websites often drive visitors away before pages finish loading, which can translate into lost enquiries for businesses. The main culprits include oversized images, excessive JavaScript loaded on first visit, missing caching for returning users, and bloated page builders or unused plugins. The article recommends testing performance on real mobile connections rather than only fast office networks. It advises fixing the largest files first and re-testing, since incremental improvements are often more effective than a full rebuild. The piece, written by Rizwan Ahmad of VentureRank Digital, frames website speed as a core element of a business's online first impression.

0
ProgrammingDEV Community ·

Safer Telegram Deep-Link Handling: Mapping Opaque Payloads to MySQL in PHP

The article explains why exposing database primary keys in Telegram deep-link payloads, such as t.me/YourBot?start=order_7821, creates security and reliability problems. Users can edit payloads to access other records or probe sequential IDs. Telegram also caps start payloads at 64 characters from a restricted set, so Base64 and hyphenated UUIDs can be truncated or fail. The recommended approach is to separate payload strings from internal IDs by mapping random opaque tokens to MySQL entities. The guide covers webhook validation, strict regex-based payload parsing, handling deep links during active conversations, and verifying payloads before updating the database.

0
ProgrammingDEV Community ·

Seven Self-Hosted Bug Trackers Compared on Deployment, Triage, and Workflow Fit

Self-hosting a bug tracker lets organizations control where issue data is stored, but it also shifts hosting and maintenance responsibilities onto the team. A guide compares seven options: ONES.com, GitLab Self-Managed, Redmine, MantisBT, Bugzilla, Tuleap, and Trac. The tools are assessed on deployment fit, defect triage configuration, connections to development workflows, and the administrative effort a team can support. Evaluation criteria include hosting and upkeep, the ability to record, search, assign, and resolve bugs, integration with source control and CI/CD, and permissions and usability for maintainers and contributors. The comparison notes that the candidates are judged against the same operational and workflow requirements, since a deployment-compliant tool must still suit how a team reports and fixes defects.