Skip to content

Commit

Permalink
Gh-2921: Fix bean registration in docs sample
Browse files Browse the repository at this point in the history
Fixes #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)
  • Loading branch information
artembilan committed Dec 4, 2023
1 parent f30d301 commit 66f585a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 66f585a

Please sign in to comment.