AMQ-6970 - Adding SSL params for RAR

Fixing missing ssl parameters when configuring rar. Also fixing
configuration logic of inproper null checks inside
ActiveMQManagedConnectionFactory

Thank you to Flavia Rainone for the patch

(cherry picked from commit e39db56934)
This commit is contained in:
Christopher L. Shannon (cshannon) 2018-07-27 07:25:35 -04:00
parent 972b3fa6cf
commit 887db9e2f2
3 changed files with 38 additions and 5 deletions

View File

@ -91,6 +91,7 @@ public class ActiveMQConnectionFactory implements ConnectionFactory, QueueConnec
if (manager == null) { if (manager == null) {
throw new JMSException("No JCA ConnectionManager configured! Either enable UseInboundSessionEnabled or get your JCA container to configure one."); throw new JMSException("No JCA ConnectionManager configured! Either enable UseInboundSessionEnabled or get your JCA container to configure one.");
} }
return (Connection)manager.allocateConnection(factory, connectionRequestInfo); return (Connection)manager.allocateConnection(factory, connectionRequestInfo);
} catch (ResourceException e) { } catch (ResourceException e) {
// Throw the root cause if it was a JMSException.. // Throw the root cause if it was a JMSException..

View File

@ -193,6 +193,10 @@ public class ActiveMQConnectionSupport {
info.setServerUrl(url); info.setServerUrl(url);
} }
public String getTrustStore() {
return info.getTrustStore();
}
public void setTrustStore(String trustStore) { public void setTrustStore(String trustStore) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug(this + ", setting [trustStore] to: " + trustStore); log.debug(this + ", setting [trustStore] to: " + trustStore);
@ -200,6 +204,10 @@ public class ActiveMQConnectionSupport {
info.setTrustStore(trustStore); info.setTrustStore(trustStore);
} }
public String getTrustStorePassword() {
return info.getTrustStorePassword();
}
public void setTrustStorePassword(String trustStorePassword) { public void setTrustStorePassword(String trustStorePassword) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug(this + ", setting [trustStorePassword] to: " + trustStorePassword); log.debug(this + ", setting [trustStorePassword] to: " + trustStorePassword);
@ -207,6 +215,10 @@ public class ActiveMQConnectionSupport {
info.setTrustStorePassword(trustStorePassword); info.setTrustStorePassword(trustStorePassword);
} }
public String getKeyStore() {
return info.getKeyStore();
}
public void setKeyStore(String keyStore) { public void setKeyStore(String keyStore) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug(this + ", setting [keyStore] to: " + keyStore); log.debug(this + ", setting [keyStore] to: " + keyStore);
@ -214,6 +226,10 @@ public class ActiveMQConnectionSupport {
info.setKeyStore(keyStore); info.setKeyStore(keyStore);
} }
public String getKeyStorePassword() {
return info.getKeyStorePassword();
}
public void setKeyStorePassword(String keyStorePassword) { public void setKeyStorePassword(String keyStorePassword) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug(this + ", setting [keyStorePassword] to: " + keyStorePassword); log.debug(this + ", setting [keyStorePassword] to: " + keyStorePassword);
@ -221,6 +237,10 @@ public class ActiveMQConnectionSupport {
info.setKeyStorePassword(keyStorePassword); info.setKeyStorePassword(keyStorePassword);
} }
public String getKeyStoreKeyPassword() {
return info.getKeyStoreKeyPassword();
}
public void setKeyStoreKeyPassword(String keyStoreKeyPassword) { public void setKeyStoreKeyPassword(String keyStoreKeyPassword) {
if (log.isDebugEnabled()) { if (log.isDebugEnabled()) {
log.debug(this + ", setting [keyStoreKeyPassword] to: " + keyStoreKeyPassword); log.debug(this + ", setting [keyStoreKeyPassword] to: " + keyStoreKeyPassword);

View File

@ -76,21 +76,33 @@ public class ActiveMQManagedConnectionFactory extends ActiveMQConnectionSupport
if (getUserName() == null) { if (getUserName() == null) {
setUserName(baseInfo.getUserName()); setUserName(baseInfo.getUserName());
} }
if (getDurableTopicPrefetch() != null) { if (getDurableTopicPrefetch() == null) {
setDurableTopicPrefetch(baseInfo.getDurableTopicPrefetch()); setDurableTopicPrefetch(baseInfo.getDurableTopicPrefetch());
} }
if (getOptimizeDurableTopicPrefetch() != null) { if (getOptimizeDurableTopicPrefetch() == null) {
setOptimizeDurableTopicPrefetch(baseInfo.getOptimizeDurableTopicPrefetch()); setOptimizeDurableTopicPrefetch(baseInfo.getOptimizeDurableTopicPrefetch());
} }
if (getQueuePrefetch() != null) { if (getQueuePrefetch() == null) {
setQueuePrefetch(baseInfo.getQueuePrefetch()); setQueuePrefetch(baseInfo.getQueuePrefetch());
} }
if (getQueueBrowserPrefetch() != null) { if (getQueueBrowserPrefetch() == null) {
setQueueBrowserPrefetch(baseInfo.getQueueBrowserPrefetch()); setQueueBrowserPrefetch(baseInfo.getQueueBrowserPrefetch());
} }
if (getTopicPrefetch() != null) { if (getTopicPrefetch() == null) {
setTopicPrefetch(baseInfo.getTopicPrefetch()); setTopicPrefetch(baseInfo.getTopicPrefetch());
} }
if (getKeyStore() == null) {
setKeyStore(baseInfo.getKeyStore());
}
if (getKeyStorePassword() == null) {
setKeyStorePassword(baseInfo.getKeyStorePassword());
}
if (getTrustStore() == null) {
setTrustStore(baseInfo.getTrustStore());
}
if (getTrustStorePassword() == null) {
setTrustStorePassword(baseInfo.getTrustStorePassword());
}
} }
} }