Hi,
I have a requirement where I am fetching data using a Service REST connector via a Data Page. Currently, the entire response is loaded first, and only then the data is displayed on the UI (portal/section).
However, my requirement is different:
I want the data to be streamed to the UI in real-time, meaning:
- As soon as partial data is received from the REST service, it should start appearing on the screen
- Data should be displayed line by line / chunk by chunk, without waiting for the full response
- The UI should update dynamically as new data arrives
Expected Behavior
- No full wait for API completion
- Incremental rendering of data
- Real-time user experience (similar to streaming responses)
Current Setup
- Data fetched via Connect REST
- Response mapped to a Data Page
- Displayed in a section/grid in the portal
Can anyone guide me how to approach this method.
Pega Connect REST supports standard request/response REST integrations, but does not natively support incremental UI rendering from SSE/streaming HTTP responses. For SSE-based real-time updates, use custom client-side EventSource handling, middleware, or an async polling architecture.
So Pega Athena gave me this response
βTo achieve progressive, streamed data presentation for case data in Pega using Connect REST, you can leverage real-time data flows with Stream Data Sets and Service REST rules. The recommended approach is to create a real-time data flow that reads from a Stream Data Set, allowing external systems to send continuous data streams. You expose this Stream Data Set via a Service REST rule, and use an Activity to save incoming data incrementally. As data arrives, it is processed and can be displayed on the UI progressively. For optimal performance and user experience, consider implementing lazy loading or server-side rendering, especially for large datasets. This ensures critical information appears first, and additional data loads as it becomes available, providing an efficient, streaming-like display. The design pattern involves prioritizing data, separating concerns by using specific tabs for different information, and optimizing performance with real-time processing.β
Any guidance if this can help me with my case?