There is a way to stream feature flag and configuration changes to the clients right when they happen. In some cases ConfigCat's pull based architecture does not completely satisfies the requirements when microservices need the latest values instantly, or mobile apps where polling sometimes is a battery consuming anti-pattern.
Your application subscribes to a PubNub channel to get updates about changes. And useConfigCat Webhooks to notify PubNub when a feature flag value gets updated.Sample application in Node.js.![push-noti](/assets/push-noti.png)
What do I need?
- A free ConfigCat account.
- A PubNub account (there is a free plan). If you don't have, you can keep going with a demo URL:
Connecting your app to ConfigCat
- Log in to ConfigCat Dashboard and create a feature flag.
- Connect your application.
- (Optional) You might want to poll ConfigCat for changes anyway but in a longer interval to make sure feature flag values updated even if there is an error delivering notifications.
Set up a Webhook to notify PubNub
- Add a HTTP GET Webhook using your PubNub URL or use
Subscribe to PubNub messages
- Set up your app to subscribe to PubNub messages.
- Make sure a
configCatClient.forceRefresh()is called to download and update the cache with new feature flag values.
- Run your application.
- Update a feature flag value on the ConfigCat Dashboard.