2016-12-28 12:41:13 +05:30
|
|
|
package com.baeldung;
|
|
|
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.boot.CommandLineRunner;
|
|
|
|
|
import org.springframework.boot.SpringApplication;
|
|
|
|
|
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
|
|
|
|
|
import org.springframework.context.annotation.ComponentScan;
|
|
|
|
|
import org.springframework.context.annotation.Configuration;
|
2017-01-03 22:23:24 +05:30
|
|
|
import org.springframework.context.annotation.Import;
|
2016-12-28 12:41:13 +05:30
|
|
|
|
|
|
|
|
import com.baeldung.consumer.NotificationConsumer;
|
|
|
|
|
|
|
|
|
|
import reactor.bus.EventBus;
|
|
|
|
|
|
|
|
|
|
import static reactor.bus.selector.Selectors.$;
|
|
|
|
|
|
|
|
|
|
@Configuration
|
|
|
|
|
@EnableAutoConfiguration
|
|
|
|
|
@ComponentScan
|
2017-01-03 22:23:24 +05:30
|
|
|
@Import(Config.class)
|
2016-12-28 12:41:13 +05:30
|
|
|
public class Application implements CommandLineRunner {
|
2016-12-28 08:19:55 +01:00
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private EventBus eventBus;
|
|
|
|
|
|
|
|
|
|
@Autowired
|
|
|
|
|
private NotificationConsumer notificationConsumer;
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void run(String... args) throws Exception {
|
|
|
|
|
eventBus.on($("notificationConsumer"), notificationConsumer);
|
|
|
|
|
}
|
2016-12-28 12:41:13 +05:30
|
|
|
|
2016-12-28 08:19:55 +01:00
|
|
|
public static void main(String[] args) {
|
|
|
|
|
SpringApplication.run(Application.class, args);
|
|
|
|
|
}
|
2016-12-28 12:41:13 +05:30
|
|
|
|
|
|
|
|
}
|