Skip to content

o.s.c.f.c.c.BeanFactoryAwareFunctionRegistry : Failed to locate function 'myfunc' for function definition 'myfunc'. Returning null. #1290

@patpatpat123

Description

@patpatpat123

Describe the bug
Hello team,

I am currently using spring-boot-starter-parent 3.5.3 (which is the latest as of this writing)

While I am not using the spring cloud dependency entirely, I am using this in my pom:

 <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-function-context</artifactId>
            <version>4.3.0</version>
        </dependency>

Here is my code:

@Service
public final class FuncService {

private final FunctionCatalog functionCatalog;
   
    public FuncService(final FunctionCatalog catalog) {
        this.functionCatalog = catalog;
      
    }

 public Flux<Bar> applyCorrectFunc(final Flux<Foo> fooFlux) {
        final Function<Flux<Foo>, Flux<Bar>> foobar = functionCatalog.lookup(applicationConfiguration.getFunctionDefinition()); //returns the name of the function 
        return foobar.apply(fooFlux);
    }

    @Bean
    public Function<Flux<Foo>, Flux<Bar>> myfunc() {
        return fooFlux -> //code to transform to barFlux;
    }

The issue is that in my log, I am always seeing this message:

o.s.c.f.c.c.BeanFactoryAwareFunctionRegistry : Failed to locate function 'myfunc' for function definition 'myfunc'. Returning null.

It seems the first call to this function will yield this message, while subsequent calls to the exact same function will work.

May I ask what is the root cause of this issue?

Thank you for your help.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions