Axon Server Plugin filtering commands in request interceptor


I want to a simple server plugin with a command request interceptor that filters out “blacklisted” (based on meta data value for example) commands. However, returning a null or Command.getDefaultInstance() resolves in an exception. In case of the latter, “No handler for command” happens. Also throwing a RequestRejectedException does not solve it. Any ideas?

Another option would be a spring boot starter with a command dispatch interceptor embedded within each of our microservice. Unfortunately maintaining a configuration for the “blacklist” becomes a pain. So having a single simple and centrally configured plugin seems to me as best option.

Thanks in advance,

Figured it out by changing the command type to a predefined string (and wrapping the payload) and adding a new microservice with a command handler to handle the “new” command.

Seems to be working nicely.

1 Like