クラス 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, 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) メソッドのサマリー
修飾子と型メソッド説明void
addConnectionListener
(ConnectionListener listener) void
protected ConnectionFactory
createConnectionFactory
(StringSE address, StringSE node) アドレス専用の接続ファクトリを作成します。void
destroy()
getHost()
int
getPhase()
int
getPort()
指定されたルックアップキーにバインドされたConnectionFactory
を返します。存在しない場合は null を返します。boolean
boolean
removeConnectionListener
(ConnectionListener listener) void
このファクトリによってキャッシュされている可能性のある接続をすべて閉じます。void
setNodeLocator
(NodeLocator<?> nodeLocator) リーダーのノードアドレスを見つけるために使用するNodeLocator
を設定します。void
start()
void
stop()
クラス 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, stop
コンストラクターの詳細
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
- トラストストアのパスフレーズ。
メソッドの詳細
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