Commit 2e8683ee by Johannes Edmeier

Remove @OnCondinalProperty("*.enabled") from Notifier beans

To make custom NotifierConfigurations easier and less error prone we now instantiate the Notifier Beans regardless of the corresponding enabled property closes #402
parent 8de56f91
...@@ -116,7 +116,6 @@ public class NotifierConfiguration { ...@@ -116,7 +116,6 @@ public class NotifierConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "spring.boot.admin.notify.mail", name = "enabled", matchIfMissing = true)
@ConfigurationProperties("spring.boot.admin.notify.mail") @ConfigurationProperties("spring.boot.admin.notify.mail")
public MailNotifier mailNotifier() { public MailNotifier mailNotifier() {
return new MailNotifier(mailSender); return new MailNotifier(mailSender);
...@@ -130,7 +129,6 @@ public class NotifierConfiguration { ...@@ -130,7 +129,6 @@ public class NotifierConfiguration {
public static class PagerdutyNotifierConfiguration { public static class PagerdutyNotifierConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "spring.boot.admin.notify.pagerduty", name = "enabled", matchIfMissing = true)
@ConfigurationProperties("spring.boot.admin.notify.pagerduty") @ConfigurationProperties("spring.boot.admin.notify.pagerduty")
public PagerdutyNotifier pagerdutyNotifier() { public PagerdutyNotifier pagerdutyNotifier() {
return new PagerdutyNotifier(); return new PagerdutyNotifier();
...@@ -144,7 +142,6 @@ public class NotifierConfiguration { ...@@ -144,7 +142,6 @@ public class NotifierConfiguration {
public static class HipchatNotifierConfiguration { public static class HipchatNotifierConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "spring.boot.admin.notify.hipchat", name = "enabled", matchIfMissing = true)
@ConfigurationProperties("spring.boot.admin.notify.hipchat") @ConfigurationProperties("spring.boot.admin.notify.hipchat")
public HipchatNotifier hipchatNotifier() { public HipchatNotifier hipchatNotifier() {
return new HipchatNotifier(); return new HipchatNotifier();
...@@ -158,7 +155,6 @@ public class NotifierConfiguration { ...@@ -158,7 +155,6 @@ public class NotifierConfiguration {
public static class SlackNotifierConfiguration { public static class SlackNotifierConfiguration {
@Bean @Bean
@ConditionalOnMissingBean @ConditionalOnMissingBean
@ConditionalOnProperty(prefix = "spring.boot.admin.notify.slack", name = "enabled", matchIfMissing = true)
@ConfigurationProperties("spring.boot.admin.notify.slack") @ConfigurationProperties("spring.boot.admin.notify.slack")
public SlackNotifier slackNotifier() { public SlackNotifier slackNotifier() {
return new SlackNotifier(); return new SlackNotifier();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment