Spring Cloud Dalston.SR4/Spring Boot 1.5.9からSpring Cloud Edgware/Spring Boot 1.5.9へのSpring Cloud DataFlowサービスのアップグレードをテストしています。私のサービスの中には、アプリスターターのソース(またはシンク)コンポーネントを拡張するものがあります。私はこれがSpring Cloud Edgwareでは動作しないことを発見しました。オーバーライドされたRabbitSourceConfiguration(app starters)はSpring Cloud Edgwareで動作しません
たとえば、私はorg.springframework.cloud.stream.app.rabbit.source.RabbitSourceConfiguration
をオーバーライドし、私のアプリケーションをオーバーライドしたバージョンにバインドしました。以前はSpring Cloudのバージョンがほぼ一年前に戻ってきました。エッジウェアで
、私は(アプリはスタンドアロンで実行したり、データフロー内にあるかどうか)は、次の取得:
***************************
APPLICATION FAILED TO START
***************************
Description:
Field channels in org.springframework.cloud.stream.app.rabbit.source.RabbitSourceConfiguration required a bean of type 'org.springframework.cloud.stream.messaging.Source' that could not be found.
Action:
Consider defining a bean of type 'org.springframework.cloud.stream.messaging.Source' in your configuration.
私は春の1.3.0.RELEASEと1.2.0.RELEASEと同じ動作を得ます-cloud-starter-stream-rabbitです。
私はRabbitSourceConfigurationをオーバーライドするので、AmqpInboundChannelAdapterにヘッダーマッパーを設定し、コンテナを起動する前に接続テストを実行することができます。
私のサブクラスは、@EnableBinding(HeaderMapperRabbitSourceConfiguration.class)
のSpring Bootアプリケーションにバインドされています。私のサブクラスの切開のバージョンは次のとおりです。
public class HeaderMapperRabbitSourceConfiguration extends RabbitSourceConfiguration {
public HeaderMapperRabbitSourceConfiguration(final MyHealthCheck healthCheck,
final MyAppConfig config) {
// ...
}
@Bean
@Override
public AmqpInboundChannelAdapter adapter() {
final AmqpInboundChannelAdapter adapter = super.adapter();
adapter.setHeaderMapper(new NotificationHeaderMapper(config));
return adapter;
}
@Bean
@Override
public SimpleMessageListenerContainer container() {
if (config.performConnectivityCheckOnStartup()) {
if (LOGGER.isInfoEnabled()) {
LOGGER.info("Attempting connectivity with ...");
}
final Health health = healthCheck.health();
if (health.getStatus() == Status.DOWN) {
LOGGER.error("Unable to connect .....");
throw new UnableToLoginException("Unable to connect ...");
} else if (LOGGER.isInfoEnabled()) {
LOGGER.info("Connectivity established with ...");
}
}
return super.container();
}
}
あなたの 'RabbitSourceConfiguration'を表示してください。 –
元の質問にconfigクラスを追加しました。 – bikerlad