How do you implement STOMP protocol in Spring WebSocket?
Step-by-step Spring Boot STOMP setup: endpoint and broker configuration, @MessageMapping handlers, SimpMessagingTemplate and a stompjs client.
2,882 posts about Java: questions with answers, tutorials and articles, newest first.
Step-by-step Spring Boot STOMP setup: endpoint and broker configuration, @MessageMapping handlers, SimpMessagingTemplate and a stompjs client.
@MessageMapping maps STOMP destinations to Spring controller methods. See broker configuration, @SendTo, SimpMessagingTemplate and a JavaScript client.
Configure STOMP messaging in Spring Boot 3, route frames with @MessageMapping, send to users and topics, scale with a broker relay and secure destinations.
SimpMessagingTemplate publishes server messages to the STOMP broker in Spring WebSocket. See the channel flow, key methods, security and broker choices.
Register a WebSocket handler in Spring Boot with WebSocketConfigurer, set safe allowed origins, test it from a browser and know when to use STOMP.
WebSocketConfigurer is how Spring registers low-level WebSocket handlers. See a working handler, origin and interceptor settings, and when STOMP is the better fit.
Set up real-time WebSocket communication in Spring Boot using a raw handler or STOMP, with server configuration, a controller and a browser client.
@EnableAsync turns on Spring's @Async support so annotated methods run on a TaskExecutor thread. Covers executors, return types and common pitfalls.
Configure and size thread pools for asynchronous tasks in Spring Boot with ThreadPoolTaskExecutor, @Async, rejection policies, virtual threads and metrics.
AsyncConfigurer lets you set the default executor and the uncaught-exception handler for @Async in one class. See both methods, examples and when to prefer other options.
Add @EnableAsync and annotate public bean methods with @Async. This guide covers executors, CompletableFuture results, virtual threads and exception handling.
The @Async annotation runs a Spring bean method on a task executor so callers do not wait. See setup, executors, error handling and pitfalls.
Use @EnableScheduling and @Scheduled(cron = ...) to run Spring Boot tasks on a schedule, with notes on time zones, thread pools and running several instances.
ScheduledTaskRegistrar lets you register and customise scheduled tasks programmatically in Spring. See dynamic cron triggers, custom thread pools and limits.
Schedule recurring jobs in Spring Boot with @Scheduled, fixed rate, fixed delay and cron, plus thread pools, dynamic scheduling and multi-instance caveats.
Use Spring Boot Actuator and Micrometer to send metrics and traces to Prometheus, Grafana, Datadog and OpenTelemetry backends.
Micrometer is the vendor-neutral metrics layer behind Spring Boot Actuator. See how to set it up, record custom meters, and export to Prometheus.
Add Actuator and Micrometer, scrape metrics with Prometheus, chart them in Grafana, add custom meters and tracing, and secure the endpoints.
Spring Boot metrics come from Micrometer and Actuator. Learn the role of MeterRegistry and the static Metrics helper, and how to record custom counters, gauges and timers.
Implement HealthIndicator in a Spring bean, return Health.up() or Health.down() with details, and expose it through the Actuator health endpoint.