static ConfigurableApplicationContext createApplicationContext(final Properties properties) {
		String transport = properties.getProperty("XD_TRANSPORT");
		// Set Rabbit message bus acknowledgement mode to 'MANUAL'
		properties.setProperty(RABBIT_ACKMODE_PROPERTY, "MANUAL");
		properties.setProperty(KAFKA_AUTO_OFFSET_COMMIT_PROPERTY, "false");
		properties.setProperty(CODEC_KRYO_REFERENCES, "true");
		SpringApplicationBuilder application = new SpringApplicationBuilder()
				.sources(MessageBusConfiguration.class)
				// ensure the properties are added at the first precedence level
				.listeners(new ApplicationListener<ApplicationEnvironmentPreparedEvent>() {
					@Override
					public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) {
						event.getEnvironment().getPropertySources().addFirst(
								new PropertiesPropertySource("executorEnvironment", properties));
					}
				})
				.web(false)
				.showBanner(false);
		application.sources(MessageBusExtensionsConfiguration.class);
		if (transport.equals("rabbit")) {
			application.sources(RabbitAutoConfiguration.class);
		}
		else if (transport.equals("redis")) {
			application.sources(RedisAutoConfiguration.class);
		}
		application.run();
		return application.context();
	}
This method called by {@link MessageBusReceiver} and {@link MessageBusSender} to setup
message bus configuration at the spark module executor process. This configuration
should use the same properties configured in XD container that deployed the spark
streaming module.

@param properties the message bus properties
@return the application context that has MessageBus bean
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/plugins/spark/streaming/MessageBusConfiguration.java