code: @Override
  	public void use(Collection<Middleware> middlewares) {
  		LinkedList<Middleware> newMiddlewares = new LinkedList<>();
  		final long stamp = lock.writeLock();
  		try {
  
  			// Register middlewares
  			for (Middleware middleware : middlewares) {
  				if (this.middlewares.add(middleware)) {
  					newMiddlewares.add(middleware);
  				}
  			}
  
  			// Apply new middlewares
  			if (!newMiddlewares.isEmpty()) {
  				for (Strategy<ActionEndpoint> strategy : strategies.values()) {
  					List<ActionEndpoint> endpoints = strategy.getAllEndpoints();
  					for (ActionEndpoint endpoint : endpoints) {
  						for (Middleware middleware : newMiddlewares) {
  							endpoint.use(middleware);
  						}
  					}
  				}
  			}
  
  		} finally {
  			lock.unlockWrite(stamp);
  		}
  
  		// Start new middlewares
  		if (!newMiddlewares.isEmpty()) {
  			for (Middleware middleware : newMiddlewares) {
  				try {
  					middleware.started(broker);
  				} catch (MoleculerError moleculerError) {
  					throw moleculerError;
  				} catch (Exception cause) {
  					throw new MoleculerError("Unable to start middleware!", cause, "MoleculerError", nodeID, false, 500,
  							"MIDDLEWARE_ERROR");
  				}
  			}
  		}
  	}
docs: --- ADD MIDDLEWARES ---