Fuse 6 is no longer supported
As of February 2025, Red Hat Fuse 6 is no longer supported. If you are using Fuse 6, please upgrade to Red Hat build of Apache Camel.此内容没有您所选择的语言版本。
17.5. Create a Custom Auditor
Prerequisities
- CDI Runtime
- Annotate your auditor implementations with @Named in order to have Camel recognize them.NoteThe Camel Exchange Bus looks for bean definitions with the @Audit annotation.Here is code that shows what a very simple auditor would look like:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow ImportantBe aware that the afterCall method is not called if the step it surrounds throws an exception. If this happens, afterCall will be skipped.
Result
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.