Interface UnitOfWorkFactory
- All Superinterfaces:
AfterPropertiesConfigured
SPI factory that creates a
UnitOfWork for each incoming Exchange.
The factory is called by the routing engine at exchange creation time; the returned UnitOfWork is attached to
the exchange for its lifetime. Implementing a custom factory is only necessary for very rare use-cases such as
integrating with an external transaction manager or attaching custom synchronization hooks globally. The created
UnitOfWork must extend DefaultUnitOfWork from camel-base-engine: that class wires the
breadcrumb ID, MDC propagation, and route-context tracking that the routing engine relies on. Implementing
UnitOfWork from scratch without extending DefaultUnitOfWork will break async routing and MDC logging
in subtle ways.
See Exchange in the Camel user manual.- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidafterPropertiesConfigured(CamelContext camelContext) Callback invoked after the element have configured its properties.createUnitOfWork(Exchange exchange) Creates a newUnitOfWork
-
Method Details
-
createUnitOfWork
Creates a newUnitOfWork- Parameters:
exchange- the exchange- Returns:
- the created
UnitOfWork
-
afterPropertiesConfigured
Description copied from interface:AfterPropertiesConfiguredCallback invoked after the element have configured its properties. This allows to perform any post init work.- Specified by:
afterPropertiesConfiguredin interfaceAfterPropertiesConfigured- Parameters:
camelContext- the Camel Context
-