I tried to use default middleware functionality as mentioned in the blog post, using the consul catalog as a provider so that I don't have to manually add tags on each consul instance.
The middleware is being applied to the routers but the lookup is in the form of @ instead of using the defined middleware in the config file.
ERRO[2020-04-12T18:44:08+05:30] middleware "usersData@consulcatalog" does not exist routerName=consul@consulcatalog entryPointName=web
ERRO[2020-04-12T18:44:08+05:30] middleware "usersData@consulcatalog" does not exist entryPointName=web routerName=web@consulcatalog
ERRO[2020-04-12T18:44:10+05:30] middleware "usersData@consulcatalog" does not exist entryPointName=web routerName=web@consulcatalog
ERRO[2020-04-12T18:44:10+05:30] middleware "usersData@consulcatalog" does not exist entryPointName=web routerName=consul@consulcatalog
ERRO[2020-04-12T18:44:12+05:30] middleware "usersData@consulcatalog" does not exist entryPointName=web routerName=consul@consulcatalog
ERRO[2020-04-12T18:44:12+05:30] middleware "usersData@consulcatalog" does not exist entryPointName=web routerName=web@consulcatalog
ERRO[2020-04-12T18:44:14+05:30] middleware "usersData@consulcatalog" does not exist entryPointName=web routerName=consul@consulcatalog
I understood that! But I want to define middleware in the static configuration and apply it to all routers. By the way I tried replacing usersData to usersData@file but here is the output I received.
ERRO[2020-04-22T14:27:24+05:30] middleware "usersData@file" does not exist entryPointName=web routerName=consul@consulcatalog
ERRO[2020-04-22T14:27:24+05:30] middleware "usersData@file" does not exist entryPointName=web routerName=web@consulcatalog
ERRO[2020-04-22T14:27:26+05:30] middleware "usersData@file" does not exist entryPointName=web routerName=consul@consulcatalog
ERRO[2020-04-22T14:27:26+05:30] middleware "usersData@file" does not exist entryPointName=web routerName=web@consulcatalog
ERRO[2020-04-22T14:27:28+05:30] middleware "usersData@file" does not exist entryPointName=web routerName=consul@consulcatalog
ERRO[2020-04-22T14:27:28+05:30] middleware "usersData@file" does not exist entryPointName=web routerName=web@consulcatalog