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.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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
@Audit(Processors.VALIDATION)
@Audit(Processors.VALIDATION)
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
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:
Copy to Clipboard
Copied!
Toggle word wrap
Toggle overflow
This bean is executed twice. One pair of before or after call for provider service and second pair for outgoing response.
@Audit(Processors.PROVIDER_CALLBACK).
@Audit(Processors.PROVIDER_CALLBACK).
@Audit({Processors.PROVIDER_CALLBACK, Processors.CONSUMER_CALLBACK})
@Audit({Processors.PROVIDER_CALLBACK, Processors.CONSUMER_CALLBACK})