May 22, 2025 - Notifications 2.0 SDK 'deleteByFilter' method is deprecated

Change Header


Change Type: API change
Product area: Application enablement & solutions
Component: Java SDK
Deployed at: eu.latest.cumulocity.com, apj.cumulocity.com, jp.cumulocity.com, cumulocity.com, us.cumulocity.com, emea.cumulocity.com

Technical details

Build artifact: cumulocity (2025.45.0)
Internal ID: MTM-63058

Change Description


The Notifications 2.0 SDK deleteByFilter() method takes a NotificationSubscriptionFilter parameter that specifies which subscriptions should be deleted.
Previously, it was possible to create a filter that would result in more subscriptions being deleted than was intended.

To resolve this issue, extra safeguards have been added to reject filters that should not be processed by the underlying platform API.
In addition, the deleteByFilter() method has been deprecated and clients should use the existing delete(), deleteById() and deleteBySource() methods instead.

1 Like

Great to read that this has been improved.
Especially this code snippet led to unexpected behaviour:

subscriptionAPI.deleteByFilter(new NotificationSubscriptionFilter().bySubscription(DEVICE_SUBSCRIPTION));

Reason: The API does not allow filtering by Subscription Name but only by ID and Source, which is fixed now.

And most important: It seems to be fixed in 2025.45.0 SDK version.