/*
* ============LICENSE_START=======================================================
* Copyright (c) 2021 Bell Canada.
+ * Modifications Copyright (C) 2022 Nordix Foundation.
* ================================================================================
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import javax.validation.constraints.Min;
import lombok.Setter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@EnableAsync
@Configuration
-@ConfigurationProperties("notification.async-executor")
+@ConditionalOnProperty(name = "notification.enabled", havingValue = "true", matchIfMissing = true)
+@ConfigurationProperties("notification.async.executor")
@Validated
@Setter
public class AsyncConfig {
@Min(2)
private int maxPoolSize = 10;
@Min(0)
- private int queueCapacity = 2147483647;
+ private int queueCapacity = Integer.MAX_VALUE;
private boolean waitForTasksToCompleteOnShutdown = true;
private String threadNamePrefix = "Async-";