Hi gonfi,
I think you should be able to extend the balancer by implementing
you own DispatchingStrategy. The inteface looks like this:
public interface DispatchingStrategy {
public Node dispatch(LoadBalancingInterceptor interceptor,
Exchange exc) throws EmptyNodeListException;
public void done(AbstractExchange exc);
}
See the ByThreadStrategy als an example the uses the done method.
https://github.com/membrane/service-proxy/blob/master/core/src/main/java/com/predic8/membrane/core/interceptor/balancer/ByThreadStrategy.java
Inside the done method you get all the information about the
exchange ( request & response ) to realize very flexible
dispatching. Just add an instance Variable to your
DispatchingStrategy the keeps the historic data to make a decission.
You should be able to do this just by adding your Jar to membrane
and by configuring it using spring without changing a single line of
code from membrane.
Give us a pull request if you want to share your contribution later
with the community.
Cheers,
Thomas
Am 14.09.15 um 03:19 schrieb gonfi: