Refactor Spring-Reactor samples
This commit is contained in:
parent
20bbeb3e65
commit
06f10646b1
@ -1,5 +1,8 @@
|
||||
package com.baeldung.poi.word;
|
||||
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xwpf.usermodel.*;
|
||||
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.net.URISyntaxException;
|
||||
@ -9,13 +12,6 @@ import java.nio.file.Paths;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import org.apache.poi.util.Units;
|
||||
import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
|
||||
import org.apache.poi.xwpf.usermodel.UnderlinePatterns;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFDocument;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFParagraph;
|
||||
import org.apache.poi.xwpf.usermodel.XWPFRun;
|
||||
|
||||
public class WordDocument {
|
||||
public static String logo = "logo-leaf.png";
|
||||
public static String paragraph1 = "poi-word-para1.txt";
|
||||
|
@ -15,7 +15,6 @@ import reactor.bus.EventBus;
|
||||
|
||||
import static reactor.bus.selector.Selectors.$;
|
||||
|
||||
|
||||
@Configuration
|
||||
@EnableAutoConfiguration
|
||||
@ComponentScan
|
||||
|
@ -20,8 +20,9 @@ public class NotificationConsumer implements Consumer<Event<NotificationData>> {
|
||||
|
||||
NotificationData notificationData = notificationDataEvent.getData();
|
||||
try {
|
||||
notificationService.initiateNotofication(notificationData);
|
||||
} catch (InterruptedException e) {}
|
||||
notificationService.initiateNotification(notificationData);
|
||||
} catch (InterruptedException e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
@ -10,24 +10,31 @@ public class NotificationData {
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(long id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public void setEmail(String email) {
|
||||
this.email = email;
|
||||
}
|
||||
|
||||
public String getMobile() {
|
||||
return mobile;
|
||||
}
|
||||
|
||||
public void setMobile(String mobile) {
|
||||
this.mobile = mobile;
|
||||
}
|
||||
|
@ -4,6 +4,6 @@ import com.baeldung.doman.NotificationData;
|
||||
|
||||
public interface NotificationService {
|
||||
|
||||
public void initiateNotofication(NotificationData notificationData) throws InterruptedException;
|
||||
void initiateNotification(NotificationData notificationData) throws InterruptedException;
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ import com.baeldung.service.NotificationService;
|
||||
public class NotificationServiceimpl implements NotificationService {
|
||||
|
||||
@Override
|
||||
public void initiateNotofication(NotificationData notificationData) throws InterruptedException {
|
||||
public void initiateNotification(NotificationData notificationData) throws InterruptedException {
|
||||
|
||||
System.out.println("Notification service started for Notification ID: " + notificationData.getId());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user