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 . |
protected String |
getKeyStore() |
protected String |
getKeyStorePassphrase() |
Class<?> |
getObjectType() |
protected String |
getSslAlgorithm() |
protected Resource |
getSslPropertiesLocation() |
protected String |
getTrustStore() |
protected String |
getTrustStorePassphrase() |
protected boolean |
isUseSSL() |
void |
setClientProperties(Map<String,Object> clientProperties)
Add custom client properties.
|
void |
setConnectionTimeout(int connectionTimeout) |
void |
setExceptionHandler(com.rabbitmq.client.ExceptionHandler exceptionHandler) |
void |
setHost(String host) |
void |
setKeyStore(String keyStore)
Set the key store resource (e.g.
|
void |
setKeyStorePassphrase(String keyStorePassphrase)
Set the key store pass phrase - overrides
the property in
setSslPropertiesLocation(Resource) . |
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) |
void |
setTrustStore(String trustStore)
Set the key store resource (e.g.
|
void |
setTrustStorePassphrase(String trustStorePassphrase)
Set the trust store pass phrase - overrides
the property in
setSslPropertiesLocation(Resource) . |
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, setSingleton
protected 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:
If this is provided, its properties (if present) will override the explicitly set property in this bean.
sslPropertiesLocation
- the Resource to the ssl propertiesprotected Resource getSslPropertiesLocation()
protected String getKeyStore()
public void setKeyStore(String keyStore)
setSslPropertiesLocation(Resource)
.keyStore
- the keystore resource.protected String getTrustStore()
public void setTrustStore(String trustStore)
setSslPropertiesLocation(Resource)
.trustStore
- the keystore resource.protected String getKeyStorePassphrase()
public void setKeyStorePassphrase(String keyStorePassphrase)
setSslPropertiesLocation(Resource)
.keyStorePassphrase
- the key store pass phrase.protected String getTrustStorePassphrase()
public void setTrustStorePassphrase(String trustStorePassphrase)
setSslPropertiesLocation(Resource)
.trustStorePassphrase
- the trust store pass phrase.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>
Exception
protected 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.