Class SpringAmqpConnectionFactory
java.lang.Object
org.springframework.amqp.client.SingleAmqpConnectionFactory
org.springframework.amqp.client.SpringAmqpConnectionFactory
- All Implemented Interfaces:
AmqpConnectionFactory, DisposableBean
The
SingleAmqpConnectionFactory extension to recover the session shared by the links of the connection.
All the links opened from a ProtonJ Connection live on its default session.
A peer may end that session while the connection stays open, for example, on an authorization error,
and ProtonJ does not replace a closed default session.
Every link on the session is gone then, and no new link can be opened on this connection.
The Connection returned from this factory opens links on a session it manages itself,
and replaces that session when it is found closed on the next attempt to open a link.
This class is a workaround and may be removed when ProtonJ recovers the default session itself.
- Since:
- 4.1.3
- Author:
- Tanishq Choudhary
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an instance based on adefault client.SpringAmqpConnectionFactory(org.apache.qpid.protonj2.client.Client protonClient) Create an instance based on the providedClient. -
Method Summary
Methods inherited from class SingleAmqpConnectionFactory
setConnectionOptions, setHost, setPassword, setPort, setReconnectOptions, setUsername
-
Constructor Details
-
SpringAmqpConnectionFactory
public SpringAmqpConnectionFactory()Create an instance based on adefault client. -
SpringAmqpConnectionFactory
public SpringAmqpConnectionFactory(org.apache.qpid.protonj2.client.Client protonClient) Create an instance based on the providedClient.- Parameters:
protonClient- the client to use.
-
-
Method Details
-
getConnection
public org.apache.qpid.protonj2.client.Connection getConnection()- Specified by:
getConnectionin interfaceAmqpConnectionFactory- Overrides:
getConnectionin classSingleAmqpConnectionFactory
-
destroy
public void destroy()- Specified by:
destroyin interfaceDisposableBean- Overrides:
destroyin classSingleAmqpConnectionFactory
-