Skip to content
Permalink
Browse files
Merge pull request #12 from jupitermoney/upstream
Support for secured MQ
  • Loading branch information
awasum committed Jan 10, 2020
2 parents 3bd10a2 + fb5d25c commit dbba791d465f7913a1d82274d5ca20874211471e
Showing 3 changed files with 10 additions and 1 deletion.
@@ -60,7 +60,7 @@ dependencies {
[group: 'org.springframework', name: 'spring-context', version: versions.springcontext],
[group: 'com.google.code.findbugs', name: 'jsr305', version: versions.findbugs],
[group: 'org.springframework', name: 'spring-jms', version: versions.springcontext],
[group: 'org.apache.activemq', name: 'activemq-spring', version: '5.13.2'],
[group: 'org.apache.activemq', name: 'activemq-spring', version: '5.15.9'],
[group: 'com.google.code.gson', name: 'gson', version: versions.gson],
[group: 'org.apache.fineract.cn', name: 'lang', version: versions.frameworklangversion],
[group: 'org.apache.fineract.cn', name: 'async', version: versions.frameworkasyncversion],
@@ -36,6 +36,8 @@
import org.springframework.jms.config.DefaultJmsListenerContainerFactory;
import org.springframework.jms.config.JmsListenerContainerFactory;
import org.springframework.jms.core.JmsTemplate;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;

@Configuration
@EnableApplicationName
@@ -71,6 +73,11 @@ public PooledConnectionFactory jmsFactory() {
this.environment.getProperty(
CommandConstants.ACTIVEMQ_BROKER_URL_PROP,
CommandConstants.ACTIVEMQ_BROKER_URL_DEFAULT));
if (!StringUtils.isEmpty(this.environment.getProperty(CommandConstants.ACTIVEMQ_USERNAME))) {
Assert.hasLength(this.environment.getProperty(CommandConstants.ACTIVEMQ_PASSWORD),"Amqp password is not supplied");
activeMQConnectionFactory.setUserName(this.environment.getProperty(CommandConstants.ACTIVEMQ_USERNAME));
activeMQConnectionFactory.setPassword(this.environment.getProperty(CommandConstants.ACTIVEMQ_PASSWORD));
}
pooledConnectionFactory.setConnectionFactory(activeMQConnectionFactory);
return pooledConnectionFactory;
}
@@ -28,6 +28,8 @@ public interface CommandConstants {
String APPLICATION_NAME_DEFAULT = "command-v1";

String ACTIVEMQ_BROKER_URL_PROP = "activemq.brokerUrl";
String ACTIVEMQ_USERNAME = "activemq.username";
String ACTIVEMQ_PASSWORD = "activemq.password";
String ACTIVEMQ_BROKER_URL_DEFAULT = "vm://localhost?broker.persistent=false";
String ACTIVEMQ_CONCURRENCY_PROP = "activemq.concurrency";
String ACTIVEMQ_CONCURRENCY_DEFAULT = "3-10";

0 comments on commit dbba791

Please sign in to comment.