Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

This repository contains an example implementation of Server-Sent Events (SSE) using the Spring Boot framework.

License

NotificationsYou must be signed in to change notification settings

robinhosz/SSE-With-SpringBoot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License

🌐 This repository contains an example implementation of Server-Sent Events (SSE) using the Spring Boot framework. SSE is a technology that enables a server to push asynchronous updates to a web client over a single, long-lived HTTP connection.

Contents

  1. 🖥️src/main/java/github/io/robinhosz/sse/controller/SSEController.java: This file contains the controller responsible for providing a continuous stream of SSE events to clients.
  2. 🛠️src/main/java/github/io/robinhosz/sse/service/SensorSimulatorService.java: Here lies the service that simulates sensor data generation at regular intervals.
  3. 📝src/main/java/github/io/robinhosz/sse/model/SensorData.java: This file defines the structure of sensor data.
  4. src/test/java/github/io/robinhosz/sse/controller/SSEControllerTest.java: Contains unit tests for the SSE controller.
  5. src/test/java/github/io/robinhosz/sse/service/SensorSimulatorServiceTest.java: Includes unit tests for the sensor data simulation service.

How to Run

  1. 🛠️ Make sure you have Java JDK and Maven installed on your system.

  2. 📥 Clone this repository to your local machine.

    git clone https://github.com/robinhosz/SSE-With-SpringBoot.git
  3. ⚙️ Navigate to the cloned directory and run the application using Maven:

    cd sse-spring-bootmvn spring-boot:run
  4. 🚀 The server will start and be available athttp://localhost:8080.

  5. 🌐Open a web browser and accesshttp://localhost:8080/events to see SSE events being continuously streamed.

Note:

This is a basic example and can be expanded to meet more complex SSE application requirements.

Contribute

  • 🤝 Feel free to submit pull requests with enhancements.
  • 🐞 Report issues or suggest new features using the Issues tab.

About

This repository contains an example implementation of Server-Sent Events (SSE) using the Spring Boot framework.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp