@@ -68,33 +68,33 @@ class Application {
68
68
// tag::beans[]
69
69
@Bean
70
70
fun template (
71
- pf : ProducerFactory <String ? , String >? ,
72
- factory : ConcurrentKafkaListenerContainerFactory <String ? , String ? >
73
- ): ReplyingKafkaTemplate <String ? , String , String ? > {
71
+ pf : ProducerFactory <String , String >,
72
+ factory : ConcurrentKafkaListenerContainerFactory <String , String >
73
+ ): ReplyingKafkaTemplate <String , String , String > {
74
74
val replyContainer = factory.createContainer(" replies" )
75
75
replyContainer.containerProperties.groupId = " request.replies"
76
- val template = ReplyingKafkaTemplate (pf, replyContainer)
76
+ val template = ReplyingKafkaTemplate < String , String , String > (pf, replyContainer)
77
77
template.messageConverter = ByteArrayJsonMessageConverter ()
78
78
template.defaultTopic = " requests"
79
79
return template
80
80
}
81
81
// end::beans[]
82
82
83
83
@Bean
84
- fun runner (template : ReplyingKafkaTemplate <String ? , String ? , String ? >): ApplicationRunner {
84
+ fun runner (template : ReplyingKafkaTemplate <String , String , String >): ApplicationRunner {
85
85
return ApplicationRunner { _ ->
86
86
// tag::sendReceive[]
87
- val future1: RequestReplyTypedMessageFuture <String ? , String ? , Thing > =
87
+ val future1: RequestReplyTypedMessageFuture <String , String , Thing > =
88
88
template.sendAndReceive(MessageBuilder .withPayload(" getAThing" ).build(),
89
89
object : ParameterizedTypeReference <Thing >() {})
90
- log.info(future1.sendFuture.get(10 , TimeUnit .SECONDS ).recordMetadata.toString())
90
+ log.info(future1.sendFuture? .get(10 , TimeUnit .SECONDS )? .recordMetadata.toString())
91
91
val thing = future1.get(10 , TimeUnit .SECONDS ).payload
92
92
log.info(thing.toString())
93
93
94
- val future2: RequestReplyTypedMessageFuture <String ? , String ? , List <Thing >> =
94
+ val future2: RequestReplyTypedMessageFuture <String , String , List <Thing >> =
95
95
template.sendAndReceive(MessageBuilder .withPayload(" getThings" ).build(),
96
96
object : ParameterizedTypeReference <List <Thing >>() {})
97
- log.info(future2.sendFuture.get(10 , TimeUnit .SECONDS ).recordMetadata.toString())
97
+ log.info(future2.sendFuture? .get(10 , TimeUnit .SECONDS )? .recordMetadata.toString())
98
98
val things = future2.get(10 , TimeUnit .SECONDS ).payload
99
99
things.forEach { thing1 -> log.info(thing1.toString()) }
100
100
// end::sendReceive[]
0 commit comments