ClusteredInvoker needs to reuse HttpInvokers (otherwise we may have performance problems downstream because a new invoker means a new Serializer, a new ObjectMapper within that serializer, etc etc).
https://github.com/errantepiphany/switchyard-core/blob/master/remote/src/main/java/org/switchyard/remote/cluster/ClusteredInvoker.java#L57
David Ward notes : What could be done to improve performance is... 2:08 Have a WeakHashMap that maps the URL behind ep.getEndpoint() to an HttpInvoker. 2:09 That way we only create new HttpInvokers for new URLs (which doesn't happen much), but since it's a WeakHashMap, the GC can clean it up if endpoint URLs change.
|