0

SpringCloudStream の Brooklyn.Release バージョンに取り組んでいます。私のユースケースには、複数のシンクを備えた HttpSource があります。Starter App の依存関係をアプリケーションに追加し、以下のように使用すると:

<dependency>
                <groupId>org.springframework.cloud.stream.app</groupId>
                <artifactId>spring-cloud-starter-stream-source-http</artifactId>
                <version>1.0.4.RELEASE</version>
</dependency>

@SpringBootApplication
@Import(HttpSourceConfiguration.class)
public class SourceApplication {
    public static void main(String[] args) {
        SpringApplication.run(SourceApplication.class, args);
    }
}

私の集計アプリは

@SpringBootApplication
public class Application {
    public static void main(String[] args) {
        new AggregateApplicationBuilder().from(SourceApplication.class)
                .via(ProcessorApplication.class).to(SinkApplication.class).args().run(args);
    }
}

以下のように常に次の応答を取得します。

<Fault xmlns="http://localhost/">
   <error>Not Found</error>
   <message>No message available</message>
   <path>/</path>
   <status>404</status>
   <timestamp>1477612242743</timestamp>
</Fault>

HttpSourceConfiguration の ComponentScan を追加しました (すぐに使用できます)。しかし、成功しません。

@SpringBootApplication
@ComponentScan(value = {"com.xxx.xxx.stream","org.springframework.cloud.stream.app.http.source"})
public class Application {
    public static void main(String[] args) {
        new AggregateApplicationBuilder().from(SourceApplication.class)
                .via(ProcessorApplication.class).to(SinkApplication.class).args().run(args);
    }
}

Rabbit Binder で同じ SourceApplication を使用すると、期待どおりに動作します。これを機能させるために私を案内してもらえますか?

あなたの助けと時間を感謝します。

よろしくカーシック

4

1 に答える 1

0

REST エンドポイントがセットアップされていないようで、この問題が発生している可能性があります。@ComponentScanパッケージが必要になりますHttpSourceConfiguration(別のパッケージからのものであるため)。

Rabbit Binder で同じ SourceApplication を使用すると、期待どおりに動作します。

httpウサギのバインダーを使用したすぐに使用できるアプリを意味しますか、それともrabbit上記でバインダーの依存関係を追加しただけSourceApplicationですか?

通常、すぐに使用できるhttpソース アプリケーション (関連付けられたバインダーを含む) を使用することを好みますが、集約アプリケーションの場合は、集約アプリ自体がブローカーにバインドされているinputか、バインドされていない限り、バインダーは必要ありません。output

于 2016-10-31T04:27:28.587 に答える