public class RabbitConnectionFactoryBean extends AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>
sslPropertiesLocation
is not null, the default implementation loads a PKCS12 keystore and a
JKS truststore using the supplied properties and intializes SunX509 key
and trust manager factories. These are then used to initialize an SSLContext
using the sslAlgorithm (default TLSv1.1).
Override createSSLContext() to create and/or perform further modification of the context.
Override setUpSSL() to take complete control over setting up SSL.
| Modifier and Type | Field and Description |
|---|---|
protected com.rabbitmq.client.ConnectionFactory |
connectionFactory |
logger| Constructor and Description |
|---|
RabbitConnectionFactoryBean() |
| Modifier and Type | Method and Description |
|---|---|
protected com.rabbitmq.client.ConnectionFactory |
createInstance() |
protected SSLContext |
createSSLContext()
Override this method to create and/or configure the
SSLContext used
by the ConnectionFactory. |
Class<?> |
getObjectType() |
protected String |
getSslAlgorithm() |
protected Resource |
getSslPropertiesLocation() |
protected boolean |
isUseSSL() |
void |
setClientProperties(Map<String,Object> clientProperties) |
void |
setConnectionTimeout(int connectionTimeout) |
void |
setExceptionHandler(com.rabbitmq.client.ExceptionHandler exceptionHandler) |
void |
setHost(String host) |
void |
setPassword(String password) |
void |
setPort(int port) |
void |
setRequestedChannelMax(int requestedChannelMax) |
void |
setRequestedFrameMax(int requestedFrameMax) |
void |
setRequestedHeartbeat(int requestedHeartbeat) |
void |
setSaslConfig(com.rabbitmq.client.SaslConfig saslConfig) |
void |
setSharedExecutor(ExecutorService executor) |
void |
setSocketConfigurator(com.rabbitmq.client.SocketConfigurator socketConfigurator) |
void |
setSocketFactory(SocketFactory factory) |
void |
setSslAlgorithm(String sslAlgorithm)
Set the algorithm to use; default TLSv1.1.
|
void |
setSslPropertiesLocation(Resource sslPropertiesLocation)
When
setUseSSL(boolean) is true, the SSL properties to use (optional). |
void |
setThreadFactory(ThreadFactory threadFactory) |
protected void |
setUpSSL()
Override this method to take complete control over the SSL setup.
|
void |
setUri(String uriString) |
void |
setUri(URI uri) |
void |
setUsername(String username) |
void |
setUseSSL(boolean useSSL)
Whether or not the factory should be configured to use SSL.
|
void |
setVirtualHost(String virtualHost) |
afterPropertiesSet, destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingletonprotected final com.rabbitmq.client.ConnectionFactory connectionFactory
public void setUseSSL(boolean useSSL)
useSSL - true to use SSL.protected boolean isUseSSL()
public void setSslAlgorithm(String sslAlgorithm)
sslAlgorithm - the algorithm.protected String getSslAlgorithm()
public void setSslPropertiesLocation(Resource sslPropertiesLocation)
setUseSSL(boolean) is true, the SSL properties to use (optional).
Resource referencing a properties file with the following properties:
sslPropertiesLocation - the Resource to the ssl propertiesprotected Resource getSslPropertiesLocation()
public void setHost(String host)
host - the host.ConnectionFactory.setHost(java.lang.String)public void setPort(int port)
port - the port.ConnectionFactory.setPort(int)public void setUsername(String username)
username - the user name.ConnectionFactory.setUsername(java.lang.String)public void setPassword(String password)
password - the password.ConnectionFactory.setPassword(java.lang.String)public void setVirtualHost(String virtualHost)
virtualHost - the virtual host.ConnectionFactory.setVirtualHost(java.lang.String)public void setUri(URI uri) throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException
uri - the uri.URISyntaxException - invalid syntax.NoSuchAlgorithmException - no such algorithm.KeyManagementException - key management.ConnectionFactory.setUri(java.net.URI)public void setUri(String uriString) throws URISyntaxException, NoSuchAlgorithmException, KeyManagementException
uriString - the uri.URISyntaxException - invalid syntax.NoSuchAlgorithmException - no such algorithm.KeyManagementException - key management.ConnectionFactory.setUri(java.lang.String)public void setRequestedChannelMax(int requestedChannelMax)
requestedChannelMax - the max requested channels.ConnectionFactory.setRequestedChannelMax(int)public void setRequestedFrameMax(int requestedFrameMax)
requestedFrameMax - the requested max frames.ConnectionFactory.setRequestedFrameMax(int)public void setConnectionTimeout(int connectionTimeout)
connectionTimeout - the connection timeout.ConnectionFactory.setConnectionTimeout(int)public void setRequestedHeartbeat(int requestedHeartbeat)
requestedHeartbeat - the requested heartbeat.ConnectionFactory.setRequestedHeartbeat(int)public void setClientProperties(Map<String,Object> clientProperties)
clientProperties - the client properties.ConnectionFactory.setClientProperties(java.util.Map)public void setSaslConfig(com.rabbitmq.client.SaslConfig saslConfig)
saslConfig - the sasl config.ConnectionFactory.setSaslConfig(com.rabbitmq.client.SaslConfig)public void setSocketFactory(SocketFactory factory)
factory - the socket factory.ConnectionFactory.setSocketFactory(javax.net.SocketFactory)public void setSocketConfigurator(com.rabbitmq.client.SocketConfigurator socketConfigurator)
socketConfigurator - the socket configurator.ConnectionFactory.setSocketConfigurator(com.rabbitmq.client.SocketConfigurator)public void setSharedExecutor(ExecutorService executor)
executor - the executor serviceConnectionFactory.setSharedExecutor(java.util.concurrent.ExecutorService)public void setThreadFactory(ThreadFactory threadFactory)
threadFactory - the thread factory.ConnectionFactory.setThreadFactory(java.util.concurrent.ThreadFactory)public void setExceptionHandler(com.rabbitmq.client.ExceptionHandler exceptionHandler)
exceptionHandler - the exception handler.ConnectionFactory.setExceptionHandler(com.rabbitmq.client.ExceptionHandler)public Class<?> getObjectType()
getObjectType in interface FactoryBean<com.rabbitmq.client.ConnectionFactory>getObjectType in class AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>protected com.rabbitmq.client.ConnectionFactory createInstance()
throws Exception
createInstance in class AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>Exceptionprotected void setUpSSL()
throws Exception
Exception - an Exception.protected SSLContext createSSLContext() throws NoSuchAlgorithmException
SSLContext used
by the ConnectionFactory.SSLContext.NoSuchAlgorithmException - if the algorithm is not available.