Upgraded Spring AMQP to 1.3.6
Creating Rabbit ConnectionFactory by passing the URI from AmqpServiceInfo.
This commit is contained in:
@@ -16,7 +16,7 @@ ext {
|
||||
springVersion = "3.1.4.RELEASE"
|
||||
tomcatVersion = "7.0.53"
|
||||
|
||||
springAmqpVersion = "1.0.0.RELEASE"
|
||||
springAmqpVersion = "1.3.6.RELEASE"
|
||||
springDataRedisVersion = "1.1.1.RELEASE"
|
||||
springDataMongoVersion = "1.2.4.RELEASE"
|
||||
|
||||
|
||||
@@ -19,19 +19,12 @@ public class RabbitConnectionFactoryCreator extends AbstractServiceConnectorCrea
|
||||
@Override
|
||||
public ConnectionFactory create(AmqpServiceInfo serviceInfo, ServiceConnectorConfig serviceConnectorConfiguration) {
|
||||
com.rabbitmq.client.ConnectionFactory connectionFactory = new com.rabbitmq.client.ConnectionFactory();
|
||||
connectionFactory.setHost(serviceInfo.getHost());
|
||||
connectionFactory.setVirtualHost(serviceInfo.getVirtualHost());
|
||||
connectionFactory.setUsername(serviceInfo.getUserName());
|
||||
connectionFactory.setPassword(serviceInfo.getPassword());
|
||||
if ("amqps".equals(serviceInfo.getScheme())) {
|
||||
try {
|
||||
connectionFactory.useSslProtocol();
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalStateException("failed to configure SSL protocol", e);
|
||||
}
|
||||
try {
|
||||
connectionFactory.setUri(serviceInfo.getUri());
|
||||
}
|
||||
catch (Exception e) {
|
||||
throw new IllegalArgumentException("failed to create ConnectionFactory", e);
|
||||
}
|
||||
connectionFactory.setPort(serviceInfo.getPort());
|
||||
CachingConnectionFactory cachingConnectionFactory = new CachingConnectionFactory(connectionFactory);
|
||||
if (serviceConnectorConfiguration != null) {
|
||||
cachingConnectionFactory.setChannelCacheSize(((RabbitConnectionFactoryConfig)serviceConnectorConfiguration).getChannelCacheSize());
|
||||
|
||||
Reference in New Issue
Block a user