Package org.apache.camel.spi
Interface InflightRepository
- All Superinterfaces:
AutoCloseable
,Service
,StaticService
A repository which tracks in flight
Exchange
s.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
Information about the inflight exchange. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds the exchange to the inflight registry to the total countervoid
Adds the exchange to the inflight registry associated to the given routevoid
Adds the route from the in flight registry.browse()
A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight.browse
(int limit, boolean sortByLongestDuration) A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight.A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight that started from the given route.A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight that started from the given route.boolean
Whether the inflight repository should allow browsing each inflight exchange.Gets the oldestInflightRepository.InflightExchange
that are currently inflight that started from the given route.void
Removes the exchange from the inflight registry to the total countervoid
Removes the exchange from the inflight registry removing association to the given routevoid
removeRoute
(String routeId) Removes the route from the in flight registry.void
setInflightBrowseEnabled
(boolean inflightBrowseEnabled) Whether the inflight repository should allow browsing each inflight exchange.int
size()
Current size of inflight exchanges.int
Current size of inflight exchanges which are from the given route.
-
Method Details
-
add
Adds the exchange to the inflight registry to the total counter- Parameters:
exchange
- the exchange
-
remove
Removes the exchange from the inflight registry to the total counter- Parameters:
exchange
- the exchange
-
add
Adds the exchange to the inflight registry associated to the given route- Parameters:
exchange
- the exchangerouteId
- the id of the route
-
remove
Removes the exchange from the inflight registry removing association to the given route- Parameters:
exchange
- the exchangerouteId
- the id of the route
-
size
int size()Current size of inflight exchanges. Will return 0 if there are no inflight exchanges.- Returns:
- number of exchanges currently in flight.
-
addRoute
Adds the route from the in flight registry. Is used for initializing up resources- Parameters:
routeId
- the id of the route
-
removeRoute
Removes the route from the in flight registry. Is used for cleaning up resources to avoid leaking.- Parameters:
routeId
- the id of the route
-
size
Current size of inflight exchanges which are from the given route. Will return 0 if there are no inflight exchanges.- Parameters:
routeId
- the id of the route- Returns:
- number of exchanges currently in flight.
-
isInflightBrowseEnabled
boolean isInflightBrowseEnabled()Whether the inflight repository should allow browsing each inflight exchange. This is by default disabled as there is a very slight performance overhead when enabled. -
setInflightBrowseEnabled
void setInflightBrowseEnabled(boolean inflightBrowseEnabled) Whether the inflight repository should allow browsing each inflight exchange. This is by default disabled as there is a very slight performance overhead when enabled.- Parameters:
inflightBrowseEnabled
- whether browsing is enabled
-
browse
A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight. -
browse
A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight that started from the given route.- Parameters:
fromRouteId
- the route id, or null for all routes.
-
browse
A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight.- Parameters:
limit
- maximum number of entries to returnsortByLongestDuration
- to sort by the longest duration. Set to true to include the exchanges that has been inflight the longest time, set to false to sort by exchange id
-
browse
Collection<InflightRepository.InflightExchange> browse(String fromRouteId, int limit, boolean sortByLongestDuration) A read-only browser of theInflightRepository.InflightExchange
s that are currently inflight that started from the given route.- Parameters:
fromRouteId
- the route id, or null for all routes.limit
- maximum number of entries to returnsortByLongestDuration
- to sort by the longest duration. Set to true to include the exchanges that has been inflight the longest time, set to false to sort by exchange id
-
oldest
Gets the oldestInflightRepository.InflightExchange
that are currently inflight that started from the given route.- Parameters:
fromRouteId
- the route id, or null for all routes.- Returns:
- the oldest, or null if none inflight
-