Menu

#4 Bug in EMS SingleConnectionFactory

open
nobody
None
5
2009-12-04
2009-12-04
No

Found a bug in the AfterPropertiesSet() method of the Spring.Messaging.Ems.Connections.SingleConnectionFactory class

Code should check for null values before trying to set the SSL proxy information on the native connection factory just like in the EmsConnectionFactory AfterPropertiesSet() method:

Current Code:

// IConnectionFactory does not implement the spring specific lifecycle interface IInitializingObject
TargetConnectionFactory.NativeConnectionFactory.SetSSLProxyAuth(SSLProxyAuthUsername, SSLProxyAuthPassword);
TargetConnectionFactory.NativeConnectionFactory.SetSSLProxy(SSLProxyHost, SSLProxyPort);

Corrected Code:

// IConnectionFactory does not implement the spring specific lifecycle interface IInitializingObject
if (SSLProxyAuthUsername != null && SSLProxyAuthPassword != null) // NSG
{
TargetConnectionFactory.NativeConnectionFactory.SetSSLProxyAuth(SSLProxyAuthUsername, SSLProxyAuthPassword);
}
if (SSLProxyHost != null && SSLProxyPort != 0)
{
TargetConnectionFactory.NativeConnectionFactory.SetSSLProxy(SSLProxyHost, SSLProxyPort);
}

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.