Red Hat Training

A Red Hat training course is available for Red Hat Fuse

17.5. Create a Custom Auditor


  • CDI Runtime
  • Annotate your auditor implementations with @Named in order to have Camel recognize them.
    The Camel Exchange Bus looks for bean definitions with the @Audit annotation.
    Here is code that shows what a very simple auditor would look like:
    @Named("custom auditor")
    public class SimpleAuditor implements Auditor {
        public void beforeCall(Processors processor, Exchange exchange) {
            System.out.println("Before " +;
        public void afterCall(Processors processor, Exchange exchange) {
            System.out.println("After " +;
    Be aware that the afterCall method is not called if the step it surrounds throws an exception. If this happens, afterCall will be skipped.


You can see many statements like 'Before DOMAIN_HANDLERS' and 'Before ADDRESSING' appearing in the server console. This is because every step of mediation is surrounded by this SimpleAuditor class.