Gh-2921: Fix bean registration in docs sample
Fixes https://github.com/spring-projects/spring-kafka/issues/2921 The `RoutingKafkaTemplate` sample configuration in the `sending-messages.adoc` use an out-dated API for `context.registerBean()` (Or the sample has never been correct)
This commit is contained in:
@@ -247,7 +247,7 @@ public class Application {
|
||||
Map<String, Object> configs = new HashMap<>(pf.getConfigurationProperties());
|
||||
configs.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, ByteArraySerializer.class);
|
||||
DefaultKafkaProducerFactory<Object, Object> bytesPF = new DefaultKafkaProducerFactory<>(configs);
|
||||
context.registerBean(DefaultKafkaProducerFactory.class, "bytesPF", bytesPF);
|
||||
context.registerBean("bytesPF", DefaultKafkaProducerFactory.class, () -> bytesPF);
|
||||
|
||||
Map<Pattern, ProducerFactory<Object, Object>> map = new LinkedHashMap<>();
|
||||
map.put(Pattern.compile("two"), bytesPF);
|
||||
|
||||
Reference in New Issue
Block a user