8000 togglz/slack at 2.6.x · adedayoominiyi/togglz · GitHub
[go: up one dir, main page]

Skip to content

Latest commit

 

History

History
 
 

slack

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Slack notifications

Slack is real-time messaging, archiving and search for teams. This togglz-slack module allows to notify your team about feature toggles changes.

  1. Set up an incoming webhook integration in your Slack team.
  2. Copy your own webhook URL from Slack website.
  3. Add togglz-slack artifact to your project dependencies and configure it.

SlackStateRepository

SlackStateRepository wrap your existing StateRepositoryadding notifications on setFeatureState.

Example Spring configuration

@Configuration
public class TogglzSlackConfig {  
    
    @Bean
    public NotificationConfiguration notificationConfiguration(@Value("${togglz.slack.hookUrl}" hookUrl){
        return NotificationConfiguration.builder()
            .withSlackHookUrl(hookUrl)
            // more (optional) configuration here
            .build();
    }

    @Bean
    public SlackStateRepository slackStateRepository(StateRepository wrapped, NotificationConfiguration config, UserProvider users) {
        return new SlackStateRepository(wrapped, config, users)
    }

}

You need to provide wrapped bean (your old StateRepository) and togglz.slack.hookUrl in properties. Now you can use SlackStateRepository to persist toggles state and to have Slack notifications at the same time. Read more about Java-based container configuration.

NotificationConfigurationBuilder

Example configuration

0