Class SingleAmqpConnectionFactory

java.lang.Object
org.springframework.amqp.client.SingleAmqpConnectionFactory
All Implemented Interfaces:
AmqpConnectionFactory, DisposableBean

public class SingleAmqpConnectionFactory extends Object implements AmqpConnectionFactory, DisposableBean
The AmqpConnectionFactory implementation to hold a single, shared Connection instance. If instance is created without a Client, a default client is used internally.
Since:
4.1
Author:
Artem Bilan
  • Constructor Details

    • SingleAmqpConnectionFactory

      public SingleAmqpConnectionFactory()
      Create an instance based on a default client.
    • SingleAmqpConnectionFactory

      public SingleAmqpConnectionFactory(org.apache.qpid.protonj2.client.Client protonClient)
      Create an instance based on the provided Client.
      Parameters:
      protonClient - the client to use.
  • Method Details

    • setHost

      public SingleAmqpConnectionFactory setHost(String host)
    • setPort

      public SingleAmqpConnectionFactory setPort(int port)
    • setUsername

      public SingleAmqpConnectionFactory setUsername(String username)
      Set the username for the AMQP connection. The convenient top-level property of the ConnectionOptions. If a ConnectionOptions is provided, the username has to be set over there.
      Parameters:
      username - the username to use.
      Returns:
      the factory instance.
    • setPassword

      public SingleAmqpConnectionFactory setPassword(String password)
      Set the password for the AMQP connection. The convenient top-level property of the ConnectionOptions. If a ConnectionOptions is provided, the password has to be set over there.
      Parameters:
      password - the password to use.
      Returns:
      the factory instance.
    • setReconnectOptions

      public SingleAmqpConnectionFactory setReconnectOptions(org.apache.qpid.protonj2.client.ReconnectOptions reconnectOptions)
      Set the ReconnectOptions for the AMQP connection. The convenient top-level property for the ConnectionOptions.reconnectOptions(). If a ConnectionOptions is provided expictily, the ReconnectOptions has to be set over there.
      Parameters:
      reconnectOptions - the ReconnectOptions to use.
      Returns:
      the factory instance.
      See Also:
    • setConnectionOptions

      public SingleAmqpConnectionFactory setConnectionOptions(org.apache.qpid.protonj2.client.ConnectionOptions connectionOptions)
      Set a ConnectionOptions instance. Mutually exclusive with setUsername(String) and setPassword(String).
      Parameters:
      connectionOptions - to use.
      Returns:
      the factory instance.
    • getConnection

      public org.apache.qpid.protonj2.client.Connection getConnection()
      Specified by:
      getConnection in interface AmqpConnectionFactory
    • destroy

      public void destroy()
      Specified by:
      destroy in interface DisposableBean