public class ThreadChannelConnectionFactory extends AbstractConnectionFactory implements com.rabbitmq.client.ShutdownListener
closeThreadChannel().AbstractConnectionFactory.AddressShuffleModeDEFAULT_CLOSE_TIMEOUT, logger| Constructor and Description |
|---|
ThreadChannelConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
Construct an instance.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addConnectionListener(ConnectionListener listener) |
void |
closeThreadChannel()
Close the channel associated with this thread, if any.
|
Connection |
createConnection() |
void |
destroy() |
boolean |
isSimplePublisherConfirms()
Return true if simple publisher confirms are enabled.
|
java.lang.Object |
prepareSwitchContext()
Call to prepare to switch the channel(s) owned by this thread to another thread.
|
void |
resetConnection()
Close the connection(s).
|
void |
setPublisherConnectionFactory(AbstractConnectionFactory publisherConnectionFactory)
Set a custom publisher connection factory; the type does not need to be the same
as this factory.
|
void |
setSimplePublisherConfirms(boolean simplePublisherConfirms)
Enable simple publisher confirms.
|
void |
switchContext(java.lang.Object toSwitch)
Acquire ownership of another thread's channel(s) after that thread called
prepareSwitchContext(). |
addChannelListener, clearConnectionListeners, createBareConnection, doSetPublisherConnectionFactory, getApplicationContext, getApplicationEventPublisher, getBeanName, getChannelListener, getCloseTimeout, getConnectionListener, getConnectionNameStrategy, getContextStopped, getDefaultHostName, getExecutorService, getHost, getPort, getPublisherConnectionFactory, getRabbitConnectionFactory, getUsername, getVirtualHost, hasPublisherConnectionFactory, onApplicationEvent, removeConnectionListener, setAddresses, setAddressResolver, setAddressShuffleMode, setApplicationContext, setApplicationEventPublisher, setBeanName, setChannelListeners, setCloseExceptionLogger, setCloseTimeout, setConnectionListeners, setConnectionNameStrategy, setConnectionThreadFactory, setConnectionTimeout, setExecutor, setHost, setPassword, setPort, setRecoveryListener, setRequestedHeartBeat, setShuffleAddresses, setUri, setUri, setUsername, setVirtualHost, shutdownCompleted, toStringclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitisPublisherConfirms, isPublisherReturnspublic ThreadChannelConnectionFactory(com.rabbitmq.client.ConnectionFactory rabbitConnectionFactory)
rabbitConnectionFactory - the rabbitmq connection factory.public void setPublisherConnectionFactory(@Nullable
AbstractConnectionFactory publisherConnectionFactory)
AbstractConnectionFactorysetPublisherConnectionFactory in class AbstractConnectionFactorypublisherConnectionFactory - the factory.public boolean isSimplePublisherConfirms()
ConnectionFactoryisSimplePublisherConfirms in interface ConnectionFactorypublic void setSimplePublisherConfirms(boolean simplePublisherConfirms)
simplePublisherConfirms - true to enable.public void addConnectionListener(ConnectionListener listener)
addConnectionListener in interface ConnectionFactoryaddConnectionListener in class AbstractConnectionFactorypublic Connection createConnection() throws org.springframework.amqp.AmqpException
createConnection in interface ConnectionFactoryorg.springframework.amqp.AmqpExceptionpublic void closeThreadChannel()
public void resetConnection()
public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeandestroy in class AbstractConnectionFactory@Nullable public java.lang.Object prepareSwitchContext()
switchContext(Object)public void switchContext(@Nullable
java.lang.Object toSwitch)
prepareSwitchContext().toSwitch - the context returned by prepareSwitchContext().prepareSwitchContext()