Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function Routing - Sucess only for first invocation #578

Closed
achatterjee104 opened this issue Aug 15, 2020 · 0 comments
Closed

Function Routing - Sucess only for first invocation #578

achatterjee104 opened this issue Aug 15, 2020 · 0 comments

Comments

@achatterjee104
Copy link

achatterjee104 commented Aug 15, 2020

Description
I am creating a vanilla web based spring-cloud-function (3.0.9.RELEASE) application containing multiple functions. I used Spring's built-in router function. Below is my configuration

spring.cloud.function.scan.packages=abhishek.scattered.springcloudfunction
spring.cloud.stream.function.routing.enabled=true

Now when I run the application and invoke the url for the first time, it is working as expected. But for second invocation (and consecutive) it is throwing exception like,
java.lang.IllegalArgumentException: Routing input of type Publisher is not supported per individual values (e.g., message header or POJO). Instead you should use 'spring.cloud.function.definition' or spring.cloud.function.routing-expression' as application properties

After debugging I also found that, for second invocation, it is not able to lookup actual function object from registry (but, for first invocation, as it is creating the function object and populating the registry for first time, it can found), hence the consecutive problem comes.

I am able to replicate this in my testcase as well, but being a new comer in spring-cloud, I am not sure if this is a framework issue or some problem in my code.

I have also posted a question regarding this in stackoverflow

Sample
Please refer to sample project in github,
scattered-spring-cloud-function-router

@olegz olegz self-assigned this Sep 14, 2020
@olegz olegz added this to the 3.1.0.RELEASE milestone Sep 14, 2020
olegz added a commit to olegz/spring-cloud-function that referenced this issue Sep 21, 2020
The root of the issue was in implementation of  equals() and hashCode() of FunctionInvocationWrapper

Resolves spring-cloud#578
@olegz olegz closed this as completed in 9f700bf Sep 21, 2020
olegz added a commit that referenced this issue Apr 18, 2023
The root of the issue was in implementation of  equals() and hashCode() of FunctionInvocationWrapper

Resolves #578
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants