Skip to content
This repository has been archived by the owner on Oct 20, 2022. It is now read-only.

Fix for #77 #81

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,22 @@ private void subscribeProvider(Provider provider, SubscribeContext subscribeCont
logger.warn("Error during subscription for {}", provider.getUrl(), throwable);
});
}

/**
* Unsubscribe from Provider of the configuration that is being deleted
* @param configuration the configuration that is being deleted
*/
public void unsubscribe(Configuration configuration){
List<EventTypeIn> eventTypeIns = Collections.emptyList();
eventTypeIns = configuration.getEventTypeIns();
for (EventTypeIn eventType : eventTypeIns) {
for (Provider provider : eventType.getProviders()) {
if (provider != null) {
unsubscribeProvider(provider);
}
}
}
}

/**
* Unsubscribe from a provider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ public synchronized ResponseEntity<Configuration> removeConfiguration() throws P
if (tenantFilter != null) {
tenantFilter.removeTenant(configurationId);
}
// Retrieve the configuration
final Configuration configuration = complexEventProcessor.getConfiguration();
// Unsubscribe from Provider of the configuration
if (configuration != null) {
subscriptionManager.unsubscribe(configuration);
}
// Reset the CEP
complexEventProcessor.reset();
// Delete the persisted configuration
Expand Down