17.6. Determine Location for Audit Assignment


In SwitchYard, you may choose to provide an argument to the @Audit annotation. The accepted values for this comes from org.switchyard.bus.camel.processors.Processors enumeration. For example, the following combination can handle only validation occurrences:
@Audit(Processors.VALIDATION)
Copy to Clipboard Toggle word wrap
Note the following important facts about validation, transformation, and transaction in SwitchYard:
  • The validation is executed twice for in-only exchanges and four times for in-out exchanges.
  • The validation occurs before and after transformation of inbound messages.
  • When SwitchYard sends outgoing messages, the validation occurs before and after transformation of outbound messages.
  • Transformation is executed once for in-only exchanges and twice for in-out exchanges.
  • Transaction phase is always executed twice.
If you want to implement only one execution of your auditor, use the following combination:
@Audit(Processors.PROVIDER_CALLBACK).
Copy to Clipboard Toggle word wrap
Here, the auditor is executed just before sending exchange to service implementation. You can also implement one auditor instance with few mediation steps. For example, a bean with annotation following:
@Audit({Processors.PROVIDER_CALLBACK, Processors.CONSUMER_CALLBACK})
Copy to Clipboard Toggle word wrap
This bean is executed twice. One pair of before or after call for provider service and second pair for outgoing response.
Back to top
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2025 Red Hat