public class StickyLoadBalancer extends QueueLoadBalancer
Expression
to calculate
a correlation key to perform the sticky load balancing; rather like jsessionid in the web
or JMSXGroupID in JMS.log
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
StickyLoadBalancer(Expression correlationExpression) |
StickyLoadBalancer(Expression correlationExpression,
QueueLoadBalancer loadBalancer) |
Modifier and Type | Method and Description |
---|---|
protected Processor |
chooseProcessor(List<Processor> processors,
Exchange exchange) |
Expression |
getCorrelationExpression() |
int |
getNumberOfHashGroups() |
protected Object |
getStickyKey(Object value)
A strategy to create the key for the sticky load balancing map.
|
void |
removeProcessor(Processor processor)
Removes the given processor from the load balancer
|
void |
setNumberOfHashGroups(int numberOfHashGroups) |
String |
toString() |
process, process
addProcessor, doStart, doStop, getProcessors, hasNext, next
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
public StickyLoadBalancer(Expression correlationExpression)
public StickyLoadBalancer(Expression correlationExpression, QueueLoadBalancer loadBalancer)
public Expression getCorrelationExpression()
protected Processor chooseProcessor(List<Processor> processors, Exchange exchange)
chooseProcessor
in class QueueLoadBalancer
public void removeProcessor(Processor processor)
LoadBalancer
removeProcessor
in interface LoadBalancer
removeProcessor
in class LoadBalancerSupport
processor
- the processor to be removed from the load balancerpublic int getNumberOfHashGroups()
public void setNumberOfHashGroups(int numberOfHashGroups)
protected Object getStickyKey(Object value)
value
- the correlation valueApache Camel