Skip to content
Advertisement

An “Error creating bean with name ‘functionBindingRegistrar'” exception every time I start my application

I have a normal spring cloud stream application that simple reads data from Kafka topic and produces messages to another Kafka topic, please find below the configurations:

JavaScript

And the following application.proeprties

JavaScript

And below is the signature of all defined spring cloud functions

JavaScript

Everything works fine, and the application starts and functions as it should, however, in the logs I encounter this exception multiple times, specially during the start up phase of the application

JavaScript

I have double checked all configurations and I still have no clue how can I prevent this issue from happening. Why this exception is happening? is it ignorable ?

UPDATE 1:

I have tracked the bug to this function in spring framework, FunctionTypeUtils:

JavaScript

this function gets called by this function in FunctionConfiguration:

JavaScript

And when I added debug points to this one, as well as the previous one I got the following output

JavaScript

Showing that the retryUnprocessedItems is the culprit, not sure why though?

Advertisement

Answer

After some investigation, it turned out that the problem is mainly with the @SchedulerLock annotation.

I observed that this issue happens while then shedLock table has lock added on the method, and hence it was preventing the FunctionBeanRegistrar from adding the method, and so the exception.

Of course this means on the other hand that the annotation is now deemed not usable because what @PollableBean annotation really runs is not the function itself, but rather the Supplier lambda expression returned by the function, practically rendering the ShedLock useless.

Once I remove the annotation, all the exceptions are gone and the sun shines again, birds sing, etc etc..

The next question to answer would be how to use rollable bean in a distributed manner but that is out of the scope of this question

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement