topologyMiddleware