@Override
			public int getOrder() {
				// Make sure producer modules get closed before the consumer modules (sink/processor)
				// by setting them the highest precedence. Smaller values come first.
				return index;
			}
Module context closer listener that sets the order based on the module deployment index.
spring-xd-module/src/main/java/org/springframework/xd/module/core/SimpleModule.java