* Update pom.xml * Add files via upload * Update Application.java * Create DataLoader.java * Create DataLoader.java * Delete DataLoader.java
39 lines
1.0 KiB
Java
39 lines
1.0 KiB
Java
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;
|
|
import org.springframework.context.annotation.Import;
|
|
|
|
import com.baeldung.consumer.NotificationConsumer;
|
|
|
|
import reactor.bus.EventBus;
|
|
|
|
import static reactor.bus.selector.Selectors.$;
|
|
|
|
@Configuration
|
|
@EnableAutoConfiguration
|
|
@ComponentScan
|
|
@Import(Config.class)
|
|
public class Application implements CommandLineRunner {
|
|
|
|
@Autowired
|
|
private EventBus eventBus;
|
|
|
|
@Autowired
|
|
private NotificationConsumer notificationConsumer;
|
|
|
|
@Override
|
|
public void run(String... args) throws Exception {
|
|
eventBus.on($("notificationConsumer"), notificationConsumer);
|
|
}
|
|
|
|
public static void main(String[] args) {
|
|
SpringApplication.run(Application.class, args);
|
|
}
|
|
|
|
}
|