クラス LocalizedQueueConnectionFactory
java.lang.ObjectSE
org.springframework.amqp.rabbit.connection.LocalizedQueueConnectionFactory
- 実装されているすべてのインターフェース:
ConnectionFactory、RoutingConnectionFactory、DisposableBean、Lifecycle、Phased、SmartLifecycle
public class LocalizedQueueConnectionFactory
extends ObjectSE
implements ConnectionFactory, RoutingConnectionFactory, DisposableBean, SmartLifecycle
キューが配置されているノードを決定し、そのノードに直接接続するファクトリを返す
RoutingConnectionFactory。RabbitMQ 管理プラグインが REST 経由で呼び出されてノードが決定され、そのノードに対応するアドレスが接続ファクトリに挿入されます。各接続ファクトリの 1 つのインスタンスがキャッシュに保持されます。場所を判別できない場合は、デフォルトの接続ファクトリが返されます。通常、この接続ファクトリは、フェイルオーバーモードですべてのサーバーに接続するように構成されます。getTargetConnectionFactory(Object) は、接続を確立するときに、'[queueName]' 形式の検索キーを使用して SimpleMessageListenerContainer によって呼び出されます。
すべての ConnectionFactory メソッドはデフォルトに委譲されます
- 導入:
- 1.2
- 作成者:
- Gary Russell, Christian Tzolov, Ngoc Nhan
フィールドのサマリー
インターフェース org.springframework.context.SmartLifecycle から継承されたフィールド
DEFAULT_PHASEコンストラクターの概要
コンストラクターコンストラクター説明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, @Nullable 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) voidprotected ConnectionFactorycreateConnectionFactory(StringSE address, StringSE node) アドレス専用の接続ファクトリを作成します。voiddestroy()@Nullable StringSEgetHost()intgetPhase()intgetPort()指定されたルックアップキーにバインドされたConnectionFactoryを返します。存在しない場合は null を返します。booleanbooleanremoveConnectionListener(ConnectionListener listener) voidこのファクトリによってキャッシュされている可能性のある接続をすべて閉じます。voidsetNodeLocator(NodeLocator<?> nodeLocator) リーダーのノードアドレスを見つけるために使用するNodeLocatorを設定します。voidstart()voidstop()クラス java.lang.ObjectSE から継承されたメソッド
clone, equalsSE, finalize, getClass, hashCode, notify, notifyAll, toString, wait, waitSE, waitSEインターフェース org.springframework.amqp.rabbit.connection.ConnectionFactory から継承されたメソッド
getPublisherConnectionFactory, isPublisherConfirms, isPublisherReturns, isSimplePublisherConfirmsインターフェース org.springframework.context.SmartLifecycle から継承されたメソッド
isAutoStartup, isPauseable, stop
コンストラクターの詳細
LocalizedQueueConnectionFactory
public LocalizedQueueConnectionFactory(ConnectionFactory defaultConnectionFactory, MapSE<StringSE, StringSE> nodeToAddress, StringSE[] adminUris, StringSE vhost, StringSE username, StringSE password, boolean useSSL, Resource sslPropertiesLocation) - パラメーター:
defaultConnectionFactory- キューが見つからない場合に使用するフォールバック接続ファクトリ。nodeToAddress- ノードからアドレスへのマップ:rabbit@server1 : server1:5672adminUris- 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- ノードからアドレスへのマップ:rabbit@server1 : server1:5672adminUris- 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- トラストストアのパスフレーズ。
メソッドの詳細
setNodeLocator
リーダーのノードアドレスを見つけるために使用するNodeLocatorを設定します。- パラメーター:
nodeLocator- ロケーター。- 導入:
- 2.4.8
createConnection
- 次で指定:
- インターフェース
ConnectionFactoryのcreateConnection - 例外:
AmqpException
getHost
- 次で指定:
- インターフェース
ConnectionFactoryのgetHost
getPort
public int getPort()- 次で指定:
- インターフェース
ConnectionFactoryのgetPort
getVirtualHost
- 次で指定:
- インターフェース
ConnectionFactoryのgetVirtualHost
getUsername
- 次で指定:
- インターフェース
ConnectionFactoryのgetUsername
getPhase
public int getPhase()- 次で指定:
- インターフェース
PhasedのgetPhase - 次で指定:
- インターフェース
SmartLifecycleのgetPhase
start
stop
isRunning
addConnectionListener
- 次で指定:
- インターフェース
ConnectionFactoryのaddConnectionListener
removeConnectionListener
- 次で指定:
- インターフェース
ConnectionFactoryのremoveConnectionListener
clearConnectionListeners
public void clearConnectionListeners()- 次で指定:
- インターフェース
ConnectionFactoryのclearConnectionListeners
getTargetConnectionFactory
インターフェースからコピーされた説明:RoutingConnectionFactory指定されたルックアップキーにバインドされたConnectionFactoryを返します。存在しない場合は null を返します。- 次で指定:
- インターフェース
RoutingConnectionFactoryのgetTargetConnectionFactory - パラメーター:
key-ConnectionFactoryがバインドされている検索キー- 戻り値:
- 指定された検索キーにバインドされた
ConnectionFactory、または存在しない場合は null
createConnectionFactory
アドレス専用の接続ファクトリを作成します。- パラメーター:
address- ファクトリが接続するアドレス。node- ノード。- 戻り値:
- 接続ファクトリ。
resetConnection
public void resetConnection()インターフェースからコピーされた説明:ConnectionFactoryこのファクトリによってキャッシュされている可能性のある接続をすべて閉じます。これは、新しい接続が開かれるのを妨げません。- 次で指定:
- インターフェース
ConnectionFactoryのresetConnection
destroy
public void destroy()- 次で指定:
- インターフェース
DisposableBeanのdestroy