クラス RabbitConnectionFactoryBean
java.lang.ObjectSE
org.springframework.beans.factory.config.AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>
org.springframework.amqp.rabbit.connection.RabbitConnectionFactoryBean
- 実装されているすべてのインターフェース:
Aware、BeanClassLoaderAware、BeanFactoryAware、DisposableBean、FactoryBean<com.rabbitmq.client.ConnectionFactory>、InitializingBean
public class RabbitConnectionFactoryBean
extends AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>
The factory bean to create a RabbitMQ ConnectionFactory, delegating most setter methods and optionally enabling SSL, with or without certificate validation. When
sslPropertiesLocation is not null, the default implementation loads a PKCS12 keystore and a JKS truststore using the supplied properties and initializes key and trust manager factories, using algorithm SunX509 by default. These are then used to initialize an SSLContextSE using the sslAlgorithm (default TLSv1.2, falling back to TLSv1.1, if 1.2 is not available).createSSLContext() をオーバーライドして、コンテキストを作成および / またはさらに変更します。
setUpSSL() をオーバーライドして、SSL の設定を完全に制御します。
- 導入:
- 1.4
- 作成者:
- Gary Russell, Heath Abelson, Arnaud Cogolu è gnes, Hareendran, Dominique Villard, Zachary DeLuca, Ngoc Nhan, Artem Bilan
フィールドのサマリー
フィールドクラス org.springframework.beans.factory.config.AbstractFactoryBean から継承されたフィールド
loggerインターフェース org.springframework.beans.factory.FactoryBean から継承されたフィールド
OBJECT_TYPE_ATTRIBUTEコンストラクターの概要
コンストラクターメソッドのサマリー
修飾子と型メソッド説明voidprotected KeyManagerSE @Nullable[]protected TrustManagerSE @Nullable[]protected com.rabbitmq.client.ConnectionFactoryprotected SSLContextSEこのメソッドをオーバーライドして、ConnectionFactoryで使用されるSSLContextSE を作成および / または構成します。protected StringSEprotected StringSEprotected @Nullable StringSEprotected @Nullable Resourceprotected StringSEキーストア型を取得します。これは、setSslPropertiesLocation(Resource)またはsetKeyStoreType(java.lang.String)によってオーバーライドされない場合、デフォルトで PKCS12 になります。ClassSE<?> com.rabbitmq.client.ConnectionFactory接続ファクトリにアクセスして、このファクトリ Bean でサポートされていないその他のプロパティを設定します。protected ResourceLoaderリソースローダーを取得します。キーストアとトラストストアResourceを入力ストリームに解決するために使用されます。protected @Nullable SecureRandomSEprotected StringSEprotected @Nullable Resourceprotected StringSEprotected StringSEprotected @Nullable StringSEprotected @Nullable Resourceprotected StringSEトラストストア型を取得します。これは、setSslPropertiesLocation(Resource)またはsetTrustStoreType(java.lang.String)によってオーバーライドされない場合、デフォルトで JKS になります。booleanWhether a Server Side certificate has to be validated or not.protected booleanisUseSSL()voidsetAutomaticRecoveryEnabled(boolean automaticRecoveryEnabled) amqp-client 自動リカバリを有効にするには、true に設定します。voidsetChannelRpcTimeout(int channelRpcTimeout) voidsetClientProperties(MapSE<StringSE, ObjectSE> clientProperties) カスタムクライアントプロパティを追加します。voidsetConnectionTimeout(int connectionTimeout) voidsetCredentialsProvider(com.rabbitmq.client.impl.CredentialsProvider provider) 資格情報プロバイダーを設定します (例:voidsetCredentialsRefreshService(com.rabbitmq.client.impl.CredentialsRefreshService service) リフレッシュサービスを設定します。voidsetEnableHostnameVerification(boolean enable) TLS 接続のサーバーホスト名検証を有効にします。voidsetExceptionHandler(com.rabbitmq.client.ExceptionHandler exceptionHandler) voidvoidsetKeyStore(@Nullable StringSE keyStore) キーストアリソースを設定します (例:voidsetKeyStoreAlgorithm(StringSE keyStoreAlgorithm) キーストアの作成時に使用するアルゴリズムを設定します。デフォルトはSunX509です。voidsetKeyStorePassphrase(@Nullable StringSE keyStorePassphrase) キーストアのパスフレーズを設定します -setSslPropertiesLocation(Resource)のプロパティを上書きします。voidsetKeyStoreResource(Resource keyStoreResource) キーストアを指す Resource を設定します。voidsetKeyStoreType(@Nullable StringSE keyStoreType) キーストア型を設定します -setSslPropertiesLocation(Resource)のプロパティをオーバーライドします。voidsetMaxInboundMessageBodySize(int maxInboundMessageBodySize) 受信 (受信) メッセージの最大本文サイズをバイト単位で設定します。voidsetMetricsCollector(com.rabbitmq.client.MetricsCollector metricsCollector) voidsetNioParams(com.rabbitmq.client.impl.nio.NioParams nioParams) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。voidsetPassword(StringSE password) voidsetPort(int port) voidsetRequestedChannelMax(int requestedChannelMax) voidsetRequestedFrameMax(int requestedFrameMax) voidsetRequestedHeartbeat(int requestedHeartbeat) voidsetResourceLoader(ResourceLoader resourceLoader) リソースローダーを設定します。キーストアとトラストストアResourceを入力ストリームに解決するために使用されます。voidsetSaslConfig(com.rabbitmq.client.SaslConfig saslConfig) voidsetSecureRandom(SecureRandomSE secureRandom) SSLContextSE の初期化時に使用するセキュアランダムを設定します。voidsetSharedExecutor(ExecutorServiceSE executor) voidsetSkipServerCertificateValidation(boolean skipServerCertificateValidation) Whether a Server Side certificate has to be validated or not.voidsetSocketConfigurator(com.rabbitmq.client.SocketConfigurator socketConfigurator) voidsetSocketFactory(SocketFactorySE factory) voidsetSslAlgorithm(StringSE sslAlgorithm) 使用するアルゴリズムを設定します。デフォルトの TLSv1.1。voidsetSslPropertiesLocation(@Nullable Resource sslPropertiesLocation) setUseSSL(boolean)が true の場合、使用する SSL プロパティ (オプション)。voidsetThreadFactory(ThreadFactorySE threadFactory) voidsetTopologyRecoveryEnabled(boolean topologyRecoveryEnabled) amqp-client トポロジーのリカバリを有効にするには、true に設定します。voidsetTrustStore(@Nullable StringSE trustStore) キーストアリソースを設定します (例:voidsetTrustStoreAlgorithm(StringSE trustStoreAlgorithm) トラストストアの作成時に使用するアルゴリズムを設定します。デフォルトはSunX509です。voidsetTrustStorePassphrase(@Nullable StringSE trustStorePassphrase) トラストストアのパスフレーズを設定します -setSslPropertiesLocation(Resource)のプロパティを上書きします。voidsetTrustStoreResource(Resource trustStoreResource) トラストストアを指す Resource を設定します。voidsetTrustStoreType(@Nullable StringSE trustStoreType) トラストストア型を設定します -setSslPropertiesLocation(Resource)のプロパティを上書きします。protected voidsetUpSSL()このメソッドをオーバーライドして、SSL セットアップを完全に制御します。voidvoidvoidsetUseNetty(boolean useNetty) Whether the factory should be configured to use Netty.voidsetUseNio(boolean useNio) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。4.0 以降、setUseNetty(boolean)を推奨voidsetUsername(StringSE username) voidsetUseSSL(boolean useSSL) SSL を使用するようにファクトリを構成する必要があるかどうか。voidsetVirtualHost(StringSE virtualHost) クラス org.springframework.beans.factory.config.AbstractFactoryBean から継承されたメソッド
destroy, destroyInstance, getBeanFactory, getBeanTypeConverter, getEarlySingletonInterfaces, getObject, isSingleton, setBeanClassLoader, setBeanFactory, setSingleton
フィールドの詳細
connectionFactory
protected final com.rabbitmq.client.ConnectionFactory connectionFactory
コンストラクターの詳細
RabbitConnectionFactoryBean
public RabbitConnectionFactoryBean()
メソッドの詳細
isSkipServerCertificateValidation
public boolean isSkipServerCertificateValidation()Whether a Server Side certificate has to be validated or not.- 戻り値:
- true if the Server Side certificate has to be skipped
- 導入:
- 1.6.6
setSkipServerCertificateValidation
public void setSkipServerCertificateValidation(boolean skipServerCertificateValidation) Whether a Server Side certificate has to be validated or not. This would be used if useSSL is set to true and should only be used on dev or Qa regions skipServerCertificateValidation should never be set to true in production- パラメーター:
skipServerCertificateValidation- サーバー側の証明書チェックを上書きするフラグ。trueに設定すると、TrustEverythingTrustManagerが使用されます。- 導入:
- 1.6.6
- 関連事項:
setUseSSL
public void setUseSSL(boolean useSSL) SSL を使用するようにファクトリを構成する必要があるかどうか。- パラメーター:
useSSL- SSL を使用する場合は true。
isUseSSL
protected boolean isUseSSL()- 戻り値:
- SSL を使用する場合は true。
- 導入:
- 1.4.4.
setSslAlgorithm
使用するアルゴリズムを設定します。デフォルトの TLSv1.1。- パラメーター:
sslAlgorithm- アルゴリズム。
getSslAlgorithm
- 戻り値:
- SSL アルゴリズム。
- 導入:
- 1.4.4
setSslPropertiesLocation
setUseSSL(boolean)が true の場合、使用する SSL プロパティ (オプション)。次のプロパティを持つプロパティファイルを参照するリソース:- keyStore= ファイル:/secret/keycert.p12
- trustStore= ファイル:/secret/trustStore
- keyStore.passPhrase= 秘密
- trustStore.passPhrase= 秘密
これが提供される場合、そのプロパティ (存在する場合) は、この Bean で明示的に設定されたプロパティをオーバーライドします。
- パラメーター:
sslPropertiesLocation- Resource を ssl プロパティに
getSslPropertiesLocation
- 戻り値:
- プロパティファイルの場所。
- 導入:
- 1.4.4
getKeyStore
- 戻り値:
- キーストアリソース。
- 導入:
- 1.5
setKeyStore
キーストアリソースを設定します (例: file:/foo/keystore) -setSslPropertiesLocation(Resource)のプロパティをオーバーライドします。リソースでsetTrustStoreResource(Resource)が呼び出された場合は無視されます。- パラメーター:
keyStore- キーストアリソース。- 導入:
- 1.5
getKeyStoreResource
setKeyStoreResource
キーストアを指す Resource を設定します。- パラメーター:
keyStoreResource- リソース。- 導入:
- 1.6.4
getTrustStore
- 戻り値:
- トラストストアリソース。
- 導入:
- 1.5
setTrustStore
キーストアリソースを設定します (例: file:/foo/truststore) -setSslPropertiesLocation(Resource)のプロパティをオーバーライドします。リソースでsetTrustStoreResource(Resource)が呼び出された場合は無視されます。- パラメーター:
trustStore- トラストストアリソース。- 導入:
- 1.5
getTrustStoreResource
setTrustStoreResource
トラストストアを指す Resource を設定します。- パラメーター:
trustStoreResource- リソース。- 導入:
- 1.6.4
getKeyStorePassphrase
- 戻り値:
- キーストアのパスフレーズ。
- 導入:
- 1.5
setKeyStorePassphrase
キーストアのパスフレーズを設定します -setSslPropertiesLocation(Resource)のプロパティを上書きします。- パラメーター:
keyStorePassphrase- キーストアのパスフレーズ。- 導入:
- 1.5
getTrustStorePassphrase
- 戻り値:
- トラストストアのパスフレーズ。
- 導入:
- 1.5
setTrustStorePassphrase
トラストストアのパスフレーズを設定します -setSslPropertiesLocation(Resource)のプロパティを上書きします。- パラメーター:
trustStorePassphrase- トラストストアのパスフレーズ。- 導入:
- 1.5
getKeyStoreType
キーストア型を取得します。これは、setSslPropertiesLocation(Resource)またはsetKeyStoreType(java.lang.String)によってオーバーライドされない場合、デフォルトで PKCS12 になります。- 戻り値:
- キーストア型。
- 導入:
- 1.6.2
setKeyStoreType
キーストア型を設定します -setSslPropertiesLocation(Resource)のプロパティをオーバーライドします。- パラメーター:
keyStoreType- キーストア型。- 導入:
- 1.6.2
- 関連事項:
getTrustStoreType
トラストストア型を取得します。これは、setSslPropertiesLocation(Resource)またはsetTrustStoreType(java.lang.String)によってオーバーライドされない場合、デフォルトで JKS になります。- 戻り値:
- トラストストアの型。
- 導入:
- 1.6.2
setTrustStoreType
トラストストア型を設定します -setSslPropertiesLocation(Resource)のプロパティを上書きします。- パラメーター:
trustStoreType- トラストストアの型。- 導入:
- 1.6.2
- 関連事項:
getSecureRandom
setSecureRandom
SSLContextSE の初期化時に使用するセキュアランダムを設定します。デフォルトは null です。この場合、デフォルトの実装が使用されます。- パラメーター:
secureRandom- 安全なランダム。- 導入:
- 1.6.4
- 関連事項:
setHost
- パラメーター:
host- ザホスト。- 関連事項:
setPort
public void setPort(int port) - パラメーター:
port- ポート。- 関連事項:
setUsername
- パラメーター:
username- ユーザー名。- 関連事項:
setPassword
- パラメーター:
password- パスワード。- 関連事項:
setCredentialsProvider
public void setCredentialsProvider(com.rabbitmq.client.impl.CredentialsProvider provider) 認証情報プロバイダーを設定します (例: OAUTH2)。- パラメーター:
provider- プロバイダー。- 導入:
- 2.3
setCredentialsRefreshService
public void setCredentialsRefreshService(com.rabbitmq.client.impl.CredentialsRefreshService service) リフレッシュサービスを設定します。- パラメーター:
service- サービス。- 導入:
- 2.3
setVirtualHost
- パラメーター:
virtualHost- 仮想ホスト。- 関連事項:
setUri
- パラメーター:
uri- uri。- 関連事項:
setUri
- パラメーター:
uriString- uri。- 関連事項:
setRequestedChannelMax
public void setRequestedChannelMax(int requestedChannelMax) - パラメーター:
requestedChannelMax- リクエストされた最大チャネル。- 関連事項:
setRequestedFrameMax
public void setRequestedFrameMax(int requestedFrameMax) - パラメーター:
requestedFrameMax- リクエストされた最大フレーム。- 関連事項:
setConnectionTimeout
public void setConnectionTimeout(int connectionTimeout) - パラメーター:
connectionTimeout- 接続タイムアウト。- 関連事項:
setRequestedHeartbeat
public void setRequestedHeartbeat(int requestedHeartbeat) - パラメーター:
requestedHeartbeat- リクエストされたハートビート。- 関連事項:
setClientProperties
setSaslConfig
public void setSaslConfig(com.rabbitmq.client.SaslConfig saslConfig) - パラメーター:
saslConfig- sasl 設定。- 関連事項:
setSocketFactory
- パラメーター:
factory- ソケットファクトリ。- 関連事項:
setSocketConfigurator
public void setSocketConfigurator(com.rabbitmq.client.SocketConfigurator socketConfigurator) - パラメーター:
socketConfigurator- ソケットコンフィギュレータ。- 関連事項:
setThreadFactory
- パラメーター:
threadFactory- スレッドファクトリ。- 関連事項:
setExceptionHandler
public void setExceptionHandler(com.rabbitmq.client.ExceptionHandler exceptionHandler) - パラメーター:
exceptionHandler- 例外ハンドラー。- 関連事項:
setUseNio
非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。4.0 以降、setUseNetty(boolean)を推奨ファクトリを Java NIO を使用するように構成するかどうか。- パラメーター:
useNio- Java NIO を使用する場合は true、ブロッキング IO を使用する場合は false- 関連事項:
setUseNetty
public void setUseNetty(boolean useNetty) Whether the factory should be configured to use Netty.- パラメーター:
useNetty- true to use Netty, false to use blocking IO- 関連事項:
setNioParams
@DeprecatedSE(since="4.0", forRemoval=true) public void setNioParams(com.rabbitmq.client.impl.nio.NioParams nioParams) 非推奨、削除予定: この API 要素は、将来のバージョンで削除される可能性があります。4.0 以降、setUseNetty(boolean)を推奨- パラメーター:
nioParams- NIO パラメーター- 関連事項:
setMetricsCollector
public void setMetricsCollector(com.rabbitmq.client.MetricsCollector metricsCollector) - パラメーター:
metricsCollector- メトリクスコレクターインスタンス- 関連事項:
setAutomaticRecoveryEnabled
public void setAutomaticRecoveryEnabled(boolean automaticRecoveryEnabled) Set to true to enable amqp-client automatic recovery. Note: Spring AMQP implements its own connection recovery, and this is generally not needed.- パラメーター:
automaticRecoveryEnabled- 有効にする場合は true。- 導入:
- 1.7.1
setTopologyRecoveryEnabled
public void setTopologyRecoveryEnabled(boolean topologyRecoveryEnabled) Set to true to enable amqp-client topology recovery. Note: if there is a Rabbit admin in the application context, Spring AMQP implements its own recovery, and this is generally not needed.- パラメーター:
topologyRecoveryEnabled- 有効にする場合は true。- 導入:
- 1.7.1
setChannelRpcTimeout
public void setChannelRpcTimeout(int channelRpcTimeout) - パラメーター:
channelRpcTimeout- チャネルでの RPC 呼び出しの継続タイムアウト- 導入:
- 2.0
- 関連事項:
setEnableHostnameVerification
public void setEnableHostnameVerification(boolean enable) TLS 接続のサーバーホスト名検証を有効にします。これにより、使用される IO モード (ブロッキングまたはノンブロッキング IO) に関係なく、ホスト名の検証が可能になります。
これは通常、
useSslProtocolメソッドの 1 つを使用してSSLContextSE を設定した後に呼び出すことができます。amqp-client 5.4.0 以降が必要です。- パラメーター:
enable- 無効にする場合は false。- 導入:
- 2.0.6
- 関連事項:
setMaxInboundMessageBodySize
public void setMaxInboundMessageBodySize(int maxInboundMessageBodySize) 受信 (受信) メッセージの最大本文サイズをバイト単位で設定します。- パラメーター:
maxInboundMessageBodySize- 最大サイズ。- 導入:
- 2.4.15
- 関連事項:
getKeyStoreAlgorithm
setKeyStoreAlgorithm
キーストアの作成時に使用するアルゴリズムを設定します。デフォルトはSunX509です。- パラメーター:
keyStoreAlgorithm- アルゴリズム。- 導入:
- 2.1.6
getTrustStoreAlgorithm
setTrustStoreAlgorithm
トラストストアの作成時に使用するアルゴリズムを設定します。デフォルトはSunX509です。- パラメーター:
trustStoreAlgorithm- アルゴリズム。- 導入:
- 2.1.6
getResourceLoader
リソースローダーを取得します。キーストアとトラストストアResourceを入力ストリームに解決するために使用されます。- 戻り値:
- リソースローダー。
- 導入:
- 2.3
setResourceLoader
リソースローダーを設定します。キーストアとトラストストアResourceを入力ストリームに解決するために使用されます。- パラメーター:
resourceLoader- リソースローダー。- 導入:
- 2.3
getRabbitConnectionFactory
public com.rabbitmq.client.ConnectionFactory getRabbitConnectionFactory()接続ファクトリにアクセスして、このファクトリ Bean でサポートされていないその他のプロパティを設定します。- 戻り値:
- 接続ファクトリ。
- 導入:
- 1.7.14
afterPropertiesSet
public void afterPropertiesSet()- 次で指定:
- インターフェース
InitializingBeanのafterPropertiesSet - オーバーライド:
- クラス
AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>のafterPropertiesSet
getObjectType
- 次で指定:
- インターフェース
FactoryBean<com.rabbitmq.client.ConnectionFactory>のgetObjectType - 次で指定:
- クラス
AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>のgetObjectType
createInstance
protected com.rabbitmq.client.ConnectionFactory createInstance()- 次で指定:
- クラス
AbstractFactoryBean<com.rabbitmq.client.ConnectionFactory>のcreateInstance
setUpSSL
protected void setUpSSL()このメソッドをオーバーライドして、SSL セットアップを完全に制御します。- 導入:
- 1.4.4
configureKeyManagers
protected KeyManagerSE @Nullable [] configureKeyManagers() throws KeyStoreExceptionSE, IOExceptionSE, NoSuchAlgorithmExceptionSE, CertificateExceptionSE, UnrecoverableKeyExceptionSEconfigureTrustManagers
protected TrustManagerSE @Nullable [] configureTrustManagers() throws KeyStoreExceptionSE, IOExceptionSE, NoSuchAlgorithmExceptionSE, CertificateExceptionSEcreateSSLContext
このメソッドをオーバーライドして、ConnectionFactoryで使用されるSSLContextSE を作成および / または構成します。- 戻り値:
SSLContextSE。- 例外:
NoSuchAlgorithmExceptionSE- アルゴリズムが利用できない場合。- 導入:
- 1.4.4
setUseNetty(boolean)を推奨