tju-yxq opened a new issue, #2580:
URL: https://github.com/apache/rocketmq-dashboard/issues/2580

   ## Problem
   
   The Alert Events page fetches every system alert in one request:
   
   ```java
   public List<SystemAlertVO> listAlerts(String level) {
       return alertRepository.findAlerts(level);
   }
   ```
   
   The page then filters and renders the full list in memory. As native alert 
collection writes events into `rmq_system_alert`, the table can grow 
continuously, but there is no bounded page size, server total, or page 
navigation.
   
   There is also a second scalability issue in the acknowledge path:
   
   ```java
   List<SystemAlertVO> alerts = alertRepository.findAlerts(null);
   SystemAlertVO alert = alerts.stream()
           .filter(a -> Objects.equals(a.getId(), id))
           .findFirst()
           .orElseThrow(...);
   ```
   
   Acknowledging a single alert therefore loads every event from the database 
just to locate one row.
   
   ## Expected behavior
   
   - Add a paginated system-alert read endpoint for the Alert Events page.
   - Support:
     - `level`
     - `page` (default 1)
     - `pageSize` (default 20, maximum 100)
   - Reject invalid pagination before repository access.
   - Apply filtering, deterministic ordering, and pagination in the database.
   - Return `items`, `total`, `page`, and `size`.
   - Keep the existing unpaginated endpoint for compatibility.
   - Acknowledge a single alert by primary key instead of scanning the full 
alert table.
   - Update the Alert Events page to use server-driven pagination, server 
total, bounded page sizes, and page reset when filters change.
   - Preserve simultaneous acknowledgement behavior.
   
   ## Verification scope
   
   Tests should cover service pagination and validation, repository SQL 
pagination/order, direct lookup by id, HTTP page contract, API query 
parameters, and the page's server-driven pagination behavior.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to