SCDF Stream Processor/Sink Apps not working if the function binding names aren't same

一笑奈何 提交于 2020-04-30 10:08:51

问题


This is a continuation of previous stackoverflow question

Adding additional details for follow up issue.

Spring Boot version 2.2.4 Cloud Version Hoxton.SR1

My Processor App

@SpringBootApplication
public class FunctionStreamSampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(FunctionStreamSampleApplication.class, args);
    }

    @Bean
    public Function<String, String> messenger() {
        return data -> "Hello : " + data.toUpperCase() + "!";
    }

}

Processor Config:

spring:
  cloud:
    stream:
      function:
        definition: messenger
        bindings:
          messenger-in-0: input
          messenger-out-0: output

Consumer App

@SpringBootApplication
public class ConsumerStreamSampleApplication {

    public static void main(String[] args) {
        SpringApplication.run(ConsumerStreamSampleApplication.class, args);
    }

    @Bean
    public Consumer<String> sample() {
         return data -> System.out.println("Sink : " + data + "!");
    }

}

Consumer Config

spring:
  cloud:
    stream:
      function:
        definition: sample
        bindings:
          sample-in-0: input

I register Processor and Sink apps in SCDF

Create a stream as :kafkaQ > customProcessor | customSink

When i deploy the stream, Sink module doesnt start up. Custom Sink has the following error message in log.

c.f.c.c.BeanFactoryAwareFunctionRegistry : Looking up function 'messenger' with acceptedOutputTypes: []
c.f.c.c.BeanFactoryAwareFunctionRegistry : !!! Failed to discover function 'messenger' in function catalog. Function available in catalog are: [sample, functionRouter]

The same sink app starts and consumes message the log the output of processor if i rename consumer function binding as well to "messenger"

@Bean
    public Consumer<String> messenger() {
         return data -> System.out.println("Sink : " + data + "!");
    }

Is it possible to know if there are other properties of configuration that is required to change so that my different processors and sink doesnt need to have the same names.

来源:https://stackoverflow.com/questions/61030849/scdf-stream-processor-sink-apps-not-working-if-the-function-binding-names-arent

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!