クラス LocalizedQueueConnectionFactory
- java.lang.ObjectSE
-
- org.springframework.amqp.rabbit.connection.LocalizedQueueConnectionFactory
- 実装されているすべてのインターフェース:
ConnectionFactory、RoutingConnectionFactory、DisposableBean
public class LocalizedQueueConnectionFactory extends ObjectSE implements ConnectionFactory, RoutingConnectionFactory, DisposableBean
キューが配置されているノードを決定し、そのノードに直接接続するファクトリを返すRoutingConnectionFactory。RabbitMQ 管理プラグインが REST 経由で呼び出されてノードが決定され、そのノードに対応するアドレスが接続ファクトリに挿入されます。各接続ファクトリの 1 つのインスタンスがキャッシュに保持されます。場所を判別できない場合は、デフォルトの接続ファクトリが返されます。通常、この接続ファクトリは、フェイルオーバーモードですべてのサーバーに接続するように構成されます。getTargetConnectionFactory(Object)は、接続を確立するときに、'[queueName]'形式の検索キーを使用してSimpleMessageListenerContainerによって呼び出されます。すべての
ConnectionFactoryメソッドはデフォルトに委譲されます- 導入:
- 1.2
- 作成者:
- Gary Russell
コンストラクターの概要
コンストラクター コンストラクター 説明 LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, StringSE[] addresses, StringSE[] adminUris, StringSE[] nodes, StringSE vhost, StringSE username, StringSE password, boolean useSSL, StringSE keyStore, StringSE trustStore, StringSE keyStorePassPhrase, StringSE trustStorePassPhrase)LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, StringSE[] addresses, StringSE[] adminUris, StringSE[] nodes, StringSE vhost, StringSE username, StringSE password, boolean useSSL, Resource sslPropertiesLocation)LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, MapSE<StringSE,StringSE> nodeToAddress, StringSE[] adminUris, StringSE vhost, StringSE username, StringSE password, boolean useSSL, StringSE keyStore, StringSE trustStore, StringSE keyStorePassPhrase, StringSE trustStorePassPhrase)LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, MapSE<StringSE,StringSE> nodeToAddress, StringSE[] adminUris, StringSE vhost, StringSE username, StringSE password, boolean useSSL, Resource sslPropertiesLocation)
メソッドのサマリー
すべてのメソッド インスタンスメソッド 具象メソッド 修飾子と型 メソッド 説明 voidaddConnectionListener(ConnectionListener listener)voidclearConnectionListeners()protected com.rabbitmq.http.client.ClientcreateClient(StringSE adminUri, StringSE username, StringSE password)クライアントインスタンスを作成します。ConnectioncreateConnection()protected ConnectionFactorycreateConnectionFactory(StringSE address, StringSE node)アドレス専用の接続ファクトリを作成します。voiddestroy()StringSEgetHost()intgetPort()ConnectionFactorygetTargetConnectionFactory(ObjectSE key)指定されたルックアップキーにバインドされたConnectionFactoryを返します。存在しない場合は null を返します。StringSEgetUsername()StringSEgetVirtualHost()booleanremoveConnectionListener(ConnectionListener listener)クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSE
インターフェース org.springframework.amqp.rabbit.connection.ConnectionFactory から継承されたメソッド
getPublisherConnectionFactory, isPublisherConfirms, isPublisherReturns, isSimplePublisherConfirms
コンストラクターの詳細
LocalizedQueueConnectionFactory
public LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, MapSE<StringSE,StringSE> nodeToAddress, StringSE[] adminUris, StringSE vhost, StringSE username, StringSE password, boolean useSSL, Resource sslPropertiesLocation)
- パラメーター:
defaultConnectionFactory- キューが見つからない場合に使用するフォールバック接続ファクトリ。nodeToAddress- アドレスへのノードのマップ: (うさぎ @ サーバー 1: サーバー 1:5672)adminUris- rabbitmq 管理アドレス (https://host:port,...) は、アドレスと同じ長さでなければなりません。vhost- 仮想ホスト。username- ユーザー名。password- パスワード。useSSL- SSL を使用する。sslPropertiesLocation- SSL プロパティの場所。
LocalizedQueueConnectionFactory
public LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, MapSE<StringSE,StringSE> nodeToAddress, StringSE[] adminUris, StringSE vhost, StringSE username, StringSE password, boolean useSSL, StringSE keyStore, StringSE trustStore, StringSE keyStorePassPhrase, StringSE trustStorePassPhrase)
- パラメーター:
defaultConnectionFactory- キューが見つからない場合に使用するフォールバック接続ファクトリ。nodeToAddress- アドレスへのノードのマップ: (うさぎ @ サーバー 1: サーバー 1:5672)adminUris- rabbitmq 管理アドレス (https://host:port,...) は、アドレスと同じ長さでなければなりません。vhost- 仮想ホスト。username- ユーザー名。password- パスワード。useSSL- SSL を使用する。keyStore- キーストアリソース (例: "file:/foo/keystore")。trustStore- トラストストアリソース (例: "file:/foo/truststore")。keyStorePassPhrase- キーストアのパスフレーズ。trustStorePassPhrase- トラストストアのパスフレーズ。
LocalizedQueueConnectionFactory
public LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, StringSE[] addresses, StringSE[] adminUris, StringSE[] nodes, StringSE vhost, StringSE username, StringSE password, boolean useSSL, @Nullable Resource sslPropertiesLocation)
- パラメーター:
defaultConnectionFactory- キューが見つからない場合に使用するフォールバック接続ファクトリ。addresses- rabbitmq サーバーのアドレス (ホスト: ポートなど)。adminUris- rabbitmq 管理アドレス (https://host:port,...)nodes- アドレス (rabbit@server1,...) に対応する Rabbitmq ノードは、アドレスと同じ長さでなければなりません。vhost- 仮想ホスト。username- ユーザー名。password- パスワード。useSSL- SSL を使用する。sslPropertiesLocation- SSL プロパティの場所。
LocalizedQueueConnectionFactory
public LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, StringSE[] addresses, StringSE[] adminUris, StringSE[] nodes, StringSE vhost, StringSE username, StringSE password, boolean useSSL, StringSE keyStore, StringSE trustStore, StringSE keyStorePassPhrase, StringSE trustStorePassPhrase)
- パラメーター:
defaultConnectionFactory- キューが見つからない場合に使用するフォールバック接続ファクトリ。addresses- rabbitmq サーバーのアドレス (ホスト: ポートなど)。adminUris- rabbitmq 管理アドレス (https://host:port,...)。nodes- アドレス (rabbit@server1,...) に対応する Rabbitmq ノードは、アドレスと同じ長さでなければなりません。vhost- 仮想ホスト。username- ユーザー名。password- パスワード。useSSL- SSL を使用する。keyStore- キーストアリソース (例: "file:/foo/keystore")。trustStore- トラストストアリソース (例: "file:/foo/truststore")。keyStorePassPhrase- キーストアのパスフレーズ。trustStorePassPhrase- トラストストアのパスフレーズ。
メソッドの詳細
createConnection
public Connection createConnection() throws AmqpException
- 次で指定:
- インターフェース
ConnectionFactoryのcreateConnection - 例外:
AmqpException
getHost
public StringSE getHost()
- 次で指定:
- インターフェース
ConnectionFactoryのgetHost
getPort
public int getPort()
- 次で指定:
- インターフェース
ConnectionFactoryのgetPort
getVirtualHost
public StringSE getVirtualHost()
- 次で指定:
- インターフェース
ConnectionFactoryのgetVirtualHost
getUsername
public StringSE getUsername()
- 次で指定:
- インターフェース
ConnectionFactoryのgetUsername
addConnectionListener
public void addConnectionListener(ConnectionListener listener)
- 次で指定:
- インターフェース
ConnectionFactoryのaddConnectionListener
removeConnectionListener
public boolean removeConnectionListener(ConnectionListener listener)
- 次で指定:
- インターフェース
ConnectionFactoryのremoveConnectionListener
clearConnectionListeners
public void clearConnectionListeners()
- 次で指定:
- インターフェース
ConnectionFactoryのclearConnectionListeners
getTargetConnectionFactory
public ConnectionFactory getTargetConnectionFactory(ObjectSE key)
インターフェースからコピーされた説明:RoutingConnectionFactory指定されたルックアップキーにバインドされたConnectionFactoryを返します。存在しない場合は null を返します。- 次で指定:
- インターフェース
RoutingConnectionFactoryのgetTargetConnectionFactory - パラメーター:
key-ConnectionFactoryがバインドされている検索キー- 戻り値:
- 指定された検索キーにバインドされた
ConnectionFactory、または存在しない場合は null
createClient
protected com.rabbitmq.http.client.Client createClient(StringSE adminUri, StringSE username, StringSE password) throws MalformedURLExceptionSE, URISyntaxExceptionSE
クライアントインスタンスを作成します。- パラメーター:
adminUri- 管理 URI。username- ユーザー名password- パスワード。- 戻り値:
- クライアント。
- 例外:
MalformedURLExceptionSE- URL の形式が正しくない場合URISyntaxExceptionSE- 構文エラーがある場合。
createConnectionFactory
protected ConnectionFactory createConnectionFactory(StringSE address, StringSE node)
アドレス専用の接続ファクトリを作成します。- パラメーター:
address- ファクトリが接続するアドレス。node- ノード。- 戻り値:
- 接続ファクトリ。
destroy
public void destroy()
- 次で指定:
- インターフェース
DisposableBeanのdestroy