Skip to content

Conversation

@bossenti
Copy link
Contributor

Purpose

As of now, only the Email and internal notification sink have the option to configure a silence period which avoids spamming the target.
This feature is really valuable and is therefore added to all notification sinks in StreamPipes. This is achieved by introducing a shared parent class called StreamPipesNotificationSink that contains everything related to the silence period.
So when implementing a notification sink, one does not have to account for the silence period in any way. Such a implementation looks like the following:

public class DemoSink extends StreamPipesNotificationSink {
  
  @Override
  public void onInvocation(
      SinkParams parameters,
      EventSinkRuntimeContext runtimeContext
  ) throws SpRuntimeException {
    super.onInvocation(parameters, runtimeContext);
    
    //...
  }
  
  @Override
  public void onDetach() {
    
  }

  @Override
  public void onNotificationEvent(Event inputEvent) {

  }

  @Override
  public DataSinkBuilder declareModelWithoutSilentPeriod() {
    return null;
  }
}

Remarks

PR introduces (a) breaking change(s): no

PR introduces (a) deprecation(s): no

@bossenti bossenti added the enhancement New feature or request label Dec 12, 2023
@bossenti bossenti added this to the 0.95.0 milestone Dec 12, 2023
@github-actions github-actions bot added java Pull requests that update Java code pipeline elements Relates to pipeline elements backend Everything that is related to the StreamPipes backend documentation Everything related to documentation testing Relates to any kind of test (unit test, integration, or E2E test). labels Dec 12, 2023
@tenthe
Copy link
Contributor

tenthe commented Dec 12, 2023

Hi @bossenti,
the PR looks good. I have a question about migrating sinks that we had in previous releases. Do we need a migration script for them because there is a new configuration option?

@bossenti
Copy link
Contributor Author

Indeed!
Thanks a lot for reminding @tenthe

I'll add the corresponding migrations

@bossenti bossenti changed the title Extend all notification sinks by a silent period Extend all MS Teams sink by a silent period Dec 12, 2023
@bossenti
Copy link
Contributor Author

@tenthe I removed the silent period from existing sinks and created an issue for their adoption: #2312
This should keep this PR small

@dominikriemer dominikriemer merged commit 96fd11c into dev Dec 12, 2023
@dominikriemer dominikriemer deleted the teams-sink-silence-period branch December 12, 2023 12:27
@bossenti bossenti changed the title Extend all MS Teams sink by a silent period Extend MS Teams sink by a silent period Dec 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Everything that is related to the StreamPipes backend documentation Everything related to documentation enhancement New feature or request java Pull requests that update Java code pipeline elements Relates to pipeline elements testing Relates to any kind of test (unit test, integration, or E2E test).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants