Interface UnitOfWorkFactory

All Superinterfaces:
AfterPropertiesConfigured

public interface UnitOfWorkFactory extends 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: