I’ve dealt with this exact issue across multiple large-scale bulk import scenarios on c8y-1019. The stale widget problem after bulk data import is a well-known architectural limitation. Let me address each focus area systematically:
Bulk Data Import Behavior: When you use the batch API for bulk imports, Cumulocity optimizes for throughput by bypassing several layers of the normal data ingestion pipeline:
- Real-time event notifications are NOT generated for bulk imported measurements
- Widget cache invalidation is NOT triggered automatically
- The “latest value” cache that data point table widgets rely on is NOT updated during bulk operations
This is by design to prevent performance degradation when importing large datasets. Your 500K measurements across 300 devices would generate massive event notification overhead if processed through the normal pipeline.
The API returns correct data because you’re querying the underlying time-series database directly, but the widget layer maintains a separate cache for performance optimization.
Widget Refresh Configuration: Data point table widgets in c8y-1019 have multiple refresh modes that behave differently:
- Real-time mode: Listens for measurement creation events (won’t work after bulk import)
- Polling mode: Periodically queries for latest values (will eventually pick up imported data)
- On-demand mode: Only refreshes when user manually triggers (requires explicit action)
Your widgets are likely in real-time mode, which explains why they’re not updating. The solution requires reconfiguring the widgets or forcing a cache refresh.
Real-Time Update Events: Since bulk imports don’t generate these events, you have three options:
Option 1 - Immediate Fix (Manual Cache Clear):
- Access Administration → Management → Cached data
- Clear the measurement cache for affected device groups
- This forces widgets to re-query the database on next load
- Refresh all dashboard pages
Option 2 - Widget Reconfiguration (Recommended):
For each data point table widget:
- Edit widget configuration
- Change data source from “Latest value (realtime)” to “Latest value (polling)”
- Set polling interval to match your monitoring requirements (e.g., 60 seconds)
- Save and refresh dashboard
This ensures widgets periodically query for latest values rather than relying on event notifications.
Option 3 - Post-Import Event Trigger (Automation):
Create a script to generate synthetic update events after bulk import completes:
// Pseudocode - Trigger widget refresh after bulk import:
1. Complete bulk import via batch API
2. Query list of affected devices
3. For each device, fetch the latest imported measurement
4. Send a lightweight "measurement updated" event to real-time channel
5. Widgets subscribed to these events will refresh automatically
// Note: This adds overhead but maintains real-time widget behavior
Best Practice for Future Imports:
-
Pre-Import: Document current widget configurations and refresh modes
-
During Import: Use bulk API as you did (correct approach for performance)
-
Post-Import: Implement automated cache invalidation:
- Call the cache clear API endpoint
- Or temporarily switch widgets to polling mode
- Or trigger synthetic events for affected devices
-
Verification: Query a sample of devices via API and compare with widget display to confirm synchronization
-
Monitoring: Set up alerts if widget values lag behind API queries by more than your acceptable threshold
Immediate Action Plan:
- Clear the measurement cache via Administration panel (affects all users, so schedule during low-usage period)
- Reconfigure critical monitoring widgets to use polling mode with 60-second intervals
- For non-critical widgets, wait for the automatic cache expiration (typically 4-6 hours)
- Document this process for future bulk imports
The combination of cache clearing and widget reconfiguration will resolve your stale data issue. Moving forward, always plan for post-import cache management when performing bulk operations. The performance benefits of bulk import are worth the extra cache management step.