私のプロジェクトでは、SSL認証メカニズムがEXTERNAL(SSL証明書のみを使用し、rabbitmqのユーザ名/パスワードを避ける)にする必要がありました。 connectionfactory beanについては、プロパティ名= "saslConfig" value = "DefaultSaslConfig.EXTERNAL"を指定しましたが、エラーが発生しています: "[java.lang.String]タイプの値を必須タイプ[com.rabbitmq.clientに変換できません.SaslConfig]プロパティ 'saslConfig':一致するエディタまたは変換戦略が見つかりませんでした "。 value = "com.rabbitmq.client.DefaultSaslConfig.EXTERNAL"やvalue = "EXTERNAL"のような他の値を試しましたが、それでもエラーはそのままです。以下の設定とログを確認して、私にあなたの提案をしてください。saslConfigを使用してspring rabbitmqが動作しない
ビーン構成
<rabbit:connection-factory id="connectionFactory" connection-factory="clientConnectionFactory" host="x.y.z.m" port="5671"/>
<bean id="clientConnectionFactory" class="org.springframework.amqp.rabbit.connection.RabbitConnectionFactoryBean">
<property name="useSSL" value="true" />
<property name="saslConfig" value=com.rabbitmq.client.DefaultSaslConfig.EXTERNAL"/>
<property name="sslPropertiesLocation" value="classpath:/rabbitSSL.properties"/></bean>
ログ
Caused by: java.lang.IllegalStateException: Cannot convert value of type [java.lang.String] to required type [com.rabbitmq.client.SaslConfig] for property 'saslConfig': no matching editors or conversion strategy found
at org.springframework.beans.TypeConverterDelegate.convertIfNecessary(TypeConverterDelegate.java:306)
at org.springframework.beans.AbstractNestablePropertyAccessor.convertIfNecessary(AbstractNestablePropertyAccessor.java:576)