|
20 | 20 | import java.util.function.Function; |
21 | 21 | import java.util.function.Supplier; |
22 | 22 |
|
23 | | -import org.apache.pulsar.client.api.Schema; |
24 | 23 | import org.apache.pulsar.common.schema.SchemaType; |
25 | 24 | import org.slf4j.Logger; |
26 | 25 | import org.slf4j.LoggerFactory; |
27 | 26 |
|
28 | | -import org.springframework.boot.ApplicationRunner; |
29 | 27 | import org.springframework.boot.SpringApplication; |
30 | 28 | import org.springframework.boot.autoconfigure.SpringBootApplication; |
31 | 29 | import org.springframework.context.annotation.Bean; |
32 | 30 | import org.springframework.pulsar.annotation.PulsarListener; |
33 | | -import org.springframework.pulsar.core.PulsarTemplate; |
34 | 31 |
|
35 | 32 | /** |
36 | 33 | * This sample binder app has an extra consumer that is equipped with Pulsar's DLT feature - timeLoggerToDlt. |
|
39 | 36 | * When doing this, in order to minimize verbose output and just to focus on the DLT feature, comment out the |
40 | 37 | * regular supplier below (timeSupplier) and then un-comment the ApplicationRunner below. |
41 | 38 | * The runner only sends a single message whereas the supplier sends a message every second. |
| 39 | + * |
| 40 | + * @author Soby Chacko |
42 | 41 | */ |
43 | 42 | @SpringBootApplication |
44 | 43 | public class SpringPulsarBinderSampleApp { |
@@ -90,7 +89,7 @@ public Consumer<EnhancedTime> timeLoggerToDlt() { |
90 | 89 |
|
91 | 90 | @PulsarListener(id = "dlqListener", topics = "notification-dlq", schemaType = SchemaType.JSON) |
92 | 91 | void listenDlq(EnhancedTime msg) { |
93 | | - System.out.println("From DLQ: " + msg); |
| 92 | + this.logger.info("From DLQ: {}", msg); |
94 | 93 | } |
95 | 94 |
|
96 | 95 | record Time(String time) { |
|
0 commit comments