Commit da2ea26c authored by I Patini's avatar I Patini
Browse files

EMS: Broker-CEP, config: Removed @Value annotations from 'BrokerCepProperties'...

EMS: Broker-CEP, config: Removed @Value annotations from 'BrokerCepProperties' class and renamed fields when needed. Changed corresponding settings in 'eu.melodic.event.brokercep.properties' (renamed settings where needed).
parent 3aa0dccc
......@@ -34,7 +34,7 @@ import java.util.Map;
@Slf4j
public class BaguetteServerProperties implements InitializingBean {
public void afterPropertiesSet() {
log.warn(">>>>>>>>>>>>>>>>>>>> {}", this);
log.debug("BaguetteServerProperties: {}", this);
}
/*XXX: TODO: Add combinatorial properties check
......
......@@ -284,14 +284,14 @@ public class BrokerConfig implements InitializingBean {
brokerService.setUseShutdownHook(properties.isBrokerUsingShutdownHook());
brokerService.setAdvisorySupport(properties.isBrokerAdvisorySupportEnabled());
brokerService.setPopulateJMSXUserID(properties.isPopulateJmsxUserId());
brokerService.setEnableStatistics(properties.isEnableStatistics());
brokerService.setPopulateJMSXUserID(properties.isBrokerPopulateJmsxUserId());
brokerService.setEnableStatistics(properties.isBrokerEnableStatistics());
// Change the JMX connector port
if (properties.getConnectorPort() > 0) {
if (properties.getManagementConnectorPort() > 0) {
if (brokerService.getManagementContext() != null) {
log.info("BrokerConfig.createBrokerService(): Setting connector port to: {}", properties.getConnectorPort());
brokerService.getManagementContext().setConnectorPort(properties.getConnectorPort());
log.info("BrokerConfig.createBrokerService(): Setting connector port to: {}", properties.getManagementConnectorPort());
brokerService.getManagementContext().setConnectorPort(properties.getManagementConnectorPort());
}
}
......@@ -321,8 +321,8 @@ public class BrokerConfig implements InitializingBean {
}
// Set memory limit in order not to use too much memory
int memHeapPercent = properties.getMemoryJvmHeapPercentage();
long memSize = properties.getMemorySize();
int memHeapPercent = properties.getUsage().getMemory().getJvmHeapPercentage();
long memSize = properties.getUsage().getMemory().getSize();
if (memHeapPercent > 0 || memSize > 0) {
final MemoryUsage memoryUsage = new MemoryUsage();
if (memHeapPercent > 0) {
......
......@@ -9,11 +9,12 @@
package eu.melodic.event.brokercep.properties;
import eu.melodic.event.util.EmsConstant;
import eu.melodic.event.util.KeystoreAndCertificateProperties;
import lombok.Data;
import lombok.ToString;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
......@@ -26,72 +27,64 @@ import java.util.Map;
@Slf4j
@Data
@Configuration
@ConfigurationProperties(prefix = "brokercep")
@ConfigurationProperties(prefix = EmsConstant.EMS_PROPERTIES_PREFIX + "brokercep")
@PropertySource("file:${MELODIC_CONFIG_DIR}/eu.melodic.event.brokercep.properties")
public class BrokerCepProperties {
public class BrokerCepProperties implements InitializingBean {
public void afterPropertiesSet() {
log.debug("BrokerCepProperties: {}", this);
}
@Value("${broker-name:broker}")
private String brokerName;
private String brokerName = "broker";
// Broker connector URLs
private List<String> brokerUrl = Collections.singletonList("ssl://0.0.0.0:61616");
public String getBrokerUrl() { return brokerUrl.get(0); }
public List<String> getBrokerUrlList() { return brokerUrl; }
@Value("${broker-url-for-consumer:ssl://127.0.0.1:61616}")
private String brokerUrlForConsumer;
@Value("#{ '${brokercep.broker-url-for-clients}'!='' ? '${brokercep.broker-url-for-clients}' : 'ssl://'+T(eu.melodic.event.util.NetUtil).getPublicIpAddress()+':61616' }")
private String brokerUrlForClients;
private String brokerUrlForConsumer = "ssl://127.0.0.1:61616";
private String brokerUrlForClients = "ssl://"+eu.melodic.event.util.NetUtil.getPublicIpAddress()+":61616";
@Value("${connector-port:-1}")
private int connectorPort;
@Value("${bypass-local-broker:false}")
private int managementConnectorPort = -1;
private boolean bypassLocalBroker;
// brokercep.ssl.** settings
private KeystoreAndCertificateProperties ssl;
@Value("${authentication-enabled:false}")
private boolean authenticationEnabled;
@ToString.Exclude
@Value("${additional-broker-credentials:}")
private String additionalBrokerCredentials;
@Value("${authorization-enabled:false}")
private boolean authorizationEnabled;
@Value("${broker-persistence-enabled:false}")
private boolean brokerPersistenceEnabled;
@Value("${broker-using-jmx:false}")
private boolean brokerUsingJmx;
@Value("${broker-advisory-support-enabled:false}")
private boolean brokerAdvisorySupportEnabled;
@Value("${broker-using-shutdown-hook:false}")
private boolean brokerUsingShutdownHook;
@Value("${broker-enable-statistics:false}")
private boolean enableStatistics;
@Value("${broker-populate-jmsx-user-id:false}")
private boolean populateJmsxUserId;
private boolean brokerEnableStatistics;
private boolean brokerPopulateJmsxUserId;
private boolean enableAdvisoryWatcher = true;
private List<MessageInterceptorConfig> messageInterceptors;
private Map<String,MessageInterceptorSpec> messageInterceptorsSpecs = new HashMap<>();
@Value("${message-forward-destinations:}#{T(java.util.Collections).emptyList()}")
private List<ForwardDestinationConfig> messageForwardDestinations;
@Value("${enable-advisory-watcher:true}")
private boolean enableAdvisoryWatcher;
private List<ForwardDestinationConfig> messageForwardDestinations = Collections.emptyList();
@Value("${brokercep.usage.memory.jvm-heap-percentage:-1}")
private int memoryJvmHeapPercentage;
@Value("${brokercep.usage.memory.size:-1}")
private long memorySize;
private int maxEventForwardRetries = -1;
private long maxEventForwardDuration = -1;
@Value("${brokercep.max-event-forward-retries:-1}")
private int maxEventForwardRetries;
@Value("${brokercep.max-event-forward-duration:-1}")
private long maxEventForwardDuration;
private Usage usage = new Usage();
@Data
public static class Usage {
private Memory memory = new Memory();
@Data
public static class Memory {
private int jvmHeapPercentage = -1;
private long size = -1;
}
}
@Data
public static class MessageInterceptorSpec {
private String className;
......
......@@ -14,7 +14,7 @@
# Broker ports and protocol
brokercep.broker-name = broker
brokercep.broker-port = 61617
#brokercep.connector-port = 1088
#brokercep.management-connector-port = 1088
brokercep.broker-protocol = ssl
# Don't use in Upperware
#brokercep.bypass-local-broker = true
......
......@@ -10,7 +10,7 @@
# Broker ports and protocol
#brokercep.broker-name = broker
brokercep.broker-port = 61617
#brokercep.connector-port = 1099
#brokercep.management-connector-port = 1099
brokercep.broker-protocol = ssl
# Don't use in Upperware
#brokercep.bypass-local-broker = true
......
Supports Markdown
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