Skip to content

Commit

Permalink
Load notifier producer at startup (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
BolZer authored Nov 18, 2024
1 parent 5a566c3 commit e3de098
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import io.github.easybill.Interceptors.GlobalExceptionInterceptor;
import io.quarkus.arc.DefaultBean;
import io.quarkus.arc.profile.IfBuildProfile;
import io.quarkus.runtime.Startup;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.enterprise.context.Dependent;
import jakarta.ws.rs.Produces;
Expand All @@ -17,6 +18,7 @@ public final class NotifierProducer {
GlobalExceptionInterceptor.class
);

@Startup
@Produces
@ApplicationScoped
@IfBuildProfile("prod")
Expand All @@ -25,7 +27,7 @@ public IExceptionNotifier realNotifier(IApplicationConfig config) {

if (bugsnagApiKey.isEmpty()) {
logger.info(
"Notifier: NOOP notifier loaded as no API-Key was provided"
"Notifier: NOOP notifier loaded as no BUGSNAG API-Key was provided"
);

return new NoopNotifier();
Expand All @@ -36,6 +38,7 @@ public IExceptionNotifier realNotifier(IApplicationConfig config) {
return new BugsnagNotifier(bugsnagApiKey.get());
}

@Startup
@Produces
@DefaultBean
@ApplicationScoped
Expand Down

0 comments on commit e3de098

Please sign in to comment.