44
44
* @author Eddú Meléndez
45
45
* @author Thomas Kåsene
46
46
* @author Moritz Halbritter
47
+ * @author Dimitrii Lipiridi
47
48
* @since 1.5.0
48
49
*/
49
- public class ConcurrentKafkaListenerContainerFactoryConfigurer {
50
+ public class ConcurrentKafkaListenerContainerFactoryConfigurer < K , V > {
50
51
51
52
private KafkaProperties properties ;
52
53
53
54
private BatchMessageConverter batchMessageConverter ;
54
55
55
56
private RecordMessageConverter recordMessageConverter ;
56
57
57
- private RecordFilterStrategy <Object , Object > recordFilterStrategy ;
58
+ private RecordFilterStrategy <? super K , ? super V > recordFilterStrategy ;
58
59
59
- private KafkaTemplate <Object , Object > replyTemplate ;
60
+ private KafkaTemplate <?, ? > replyTemplate ;
60
61
61
- private KafkaAwareTransactionManager <Object , Object > transactionManager ;
62
+ private KafkaAwareTransactionManager <?, ? > transactionManager ;
62
63
63
64
private ConsumerAwareRebalanceListener rebalanceListener ;
64
65
65
66
private CommonErrorHandler commonErrorHandler ;
66
67
67
- private AfterRollbackProcessor <Object , Object > afterRollbackProcessor ;
68
+ private AfterRollbackProcessor <? super K , ? super V > afterRollbackProcessor ;
68
69
69
- private RecordInterceptor <Object , Object > recordInterceptor ;
70
+ private RecordInterceptor <K , V > recordInterceptor ;
70
71
71
- private BatchInterceptor <Object , Object > batchInterceptor ;
72
+ private BatchInterceptor <K , V > batchInterceptor ;
72
73
73
74
private Function <MessageListenerContainer , String > threadNameSupplier ;
74
75
@@ -102,23 +103,23 @@ void setRecordMessageConverter(RecordMessageConverter recordMessageConverter) {
102
103
* Set the {@link RecordFilterStrategy} to use to filter incoming records.
103
104
* @param recordFilterStrategy the record filter strategy
104
105
*/
105
- void setRecordFilterStrategy (RecordFilterStrategy <Object , Object > recordFilterStrategy ) {
106
+ void setRecordFilterStrategy (RecordFilterStrategy <? super K , ? super V > recordFilterStrategy ) {
106
107
this .recordFilterStrategy = recordFilterStrategy ;
107
108
}
108
109
109
110
/**
110
111
* Set the {@link KafkaTemplate} to use to send replies.
111
112
* @param replyTemplate the reply template
112
113
*/
113
- void setReplyTemplate (KafkaTemplate <Object , Object > replyTemplate ) {
114
+ void setReplyTemplate (KafkaTemplate <?, ? > replyTemplate ) {
114
115
this .replyTemplate = replyTemplate ;
115
116
}
116
117
117
118
/**
118
119
* Set the {@link KafkaAwareTransactionManager} to use.
119
120
* @param transactionManager the transaction manager
120
121
*/
121
- void setTransactionManager (KafkaAwareTransactionManager <Object , Object > transactionManager ) {
122
+ void setTransactionManager (KafkaAwareTransactionManager <?, ? > transactionManager ) {
122
123
this .transactionManager = transactionManager ;
123
124
}
124
125
@@ -144,23 +145,23 @@ public void setCommonErrorHandler(CommonErrorHandler commonErrorHandler) {
144
145
* Set the {@link AfterRollbackProcessor} to use.
145
146
* @param afterRollbackProcessor the after rollback processor
146
147
*/
147
- void setAfterRollbackProcessor (AfterRollbackProcessor <Object , Object > afterRollbackProcessor ) {
148
+ void setAfterRollbackProcessor (AfterRollbackProcessor <? super K , ? super V > afterRollbackProcessor ) {
148
149
this .afterRollbackProcessor = afterRollbackProcessor ;
149
150
}
150
151
151
152
/**
152
153
* Set the {@link RecordInterceptor} to use.
153
154
* @param recordInterceptor the record interceptor.
154
155
*/
155
- void setRecordInterceptor (RecordInterceptor <Object , Object > recordInterceptor ) {
156
+ void setRecordInterceptor (RecordInterceptor <K , V > recordInterceptor ) {
156
157
this .recordInterceptor = recordInterceptor ;
157
158
}
158
159
159
160
/**
160
161
* Set the {@link BatchInterceptor} to use.
161
162
* @param batchInterceptor the batch interceptor.
162
163
*/
163
- void setBatchInterceptor (BatchInterceptor <Object , Object > batchInterceptor ) {
164
+ void setBatchInterceptor (BatchInterceptor <K , V > batchInterceptor ) {
164
165
this .batchInterceptor = batchInterceptor ;
165
166
}
166
167
@@ -187,14 +188,14 @@ void setListenerTaskExecutor(SimpleAsyncTaskExecutor listenerTaskExecutor) {
187
188
* to configure
188
189
* @param consumerFactory the {@link ConsumerFactory} to use
189
190
*/
190
- public void configure (ConcurrentKafkaListenerContainerFactory <Object , Object > listenerFactory ,
191
- ConsumerFactory <Object , Object > consumerFactory ) {
191
+ public void configure (ConcurrentKafkaListenerContainerFactory <K , V > listenerFactory ,
192
+ ConsumerFactory <? super K , ? super V > consumerFactory ) {
192
193
listenerFactory .setConsumerFactory (consumerFactory );
193
194
configureListenerFactory (listenerFactory );
194
195
configureContainer (listenerFactory .getContainerProperties ());
195
196
}
196
197
197
- private void configureListenerFactory (ConcurrentKafkaListenerContainerFactory <Object , Object > factory ) {
198
+ private void configureListenerFactory (ConcurrentKafkaListenerContainerFactory <K , V > factory ) {
198
199
PropertyMapper map = PropertyMapper .get ().alwaysApplyingWhenNonNull ();
199
200
Listener properties = this .properties .getListener ();
200
201
map .from (properties ::getConcurrency ).to (factory ::setConcurrency );
0 commit comments