Open pcabot opened 6 years ago
I think that is right. zuul2 encourages using groovy for filters which is a dynamic jvm language. I guess the developer team wants to have it more like riemann, a real time pipe of processors. zuul 2 is designed to be of such must be because of netflix usages.
You can load filters from a JAR if you use packages or class names, rather than file folders.
Can you explain what you mean by "use packages or class names" ?
Do you mean changing the value of the zuul.filters.root
property to something else than : zuul.filters.root=src/main/groovy/com/company/apigateway/filters
?
Can you give an example please ? thanks!
You can use the properties: zuul.filters.packages
or zuul.filters.classes
. For example: https://github.com/Netflix/zuul/blob/2.1/zuul-sample/src/main/resources/application.properties#L27
I have the same issue. I've followed the same path structure as shown in the application.properties file in the zuul2 repository
Hi, I am packaging my zuul 2 server application as a jar and I included the groovy filter source files in it (in a
com/company/apigateway/filters
folder, which is the same path specified in theapplication.properties
file).When trying to run the app using
java -jar myapp.jar
, I get an error related to loading filters:So, after looking at the code, it looks like that Zuul is creating a new
File
object for each filter file found in the class path. But, the constructor ofFile
class does not seem to accept file path from within jars.The zuul2 wiki also mentions that
Bottom line, in order for Zuul2 to work, the fiters must be packaged in a folder outside the jar. Is that correct ? Thanks