I could run Harness example here
but I copied the code to another directory and use the same dependencies in pom.xml
, it raised error that no routers defined
I debug and found that MyModule
which extends StateFunModule
was not found. Thus the class loader get no module and the router and func size is 0 and failed in validation step. (The step to check ingress, egress, router, func not size 0)
PS: I just copied all the code, thus @AutoService
is also included. According to here, it should work without further configuration.
Update:
Seems its statefun issue related to @AutoService
I added following code in the pom in another project (unrelated to statefun)
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0-rc6</version>
<optional>true</optional>
</dependency>
It works, the META-INF is generated.
But if using
<dependency>
<groupId>org.apache.flink</groupId>
<artifactId>statefun-flink-distribution</artifactId>
<version>2.2-SNAPSHOT</version>
</dependency>
The META-INF is not generated, and I found in statefun, the dependency used is actually
<dependency>
<groupId>com.google.auto.service</groupId>
<artifactId>auto-service</artifactId>
<version>1.0-rc6</version>
<optional>true</optional>
</dependency>
And I test this dependency, it could not generate META-INF, and I am curious that why if we directly clone the statefun repo and mvn clean package
, it could work.