Skip to content

Commit

Permalink
Merge pull request #64 from abes-esr/FIX_transaction_timout
Browse files Browse the repository at this point in the history
FIX : transaction timeout
  • Loading branch information
pierre-maraval authored Nov 21, 2023
2 parents 80bd070 + 47af6cb commit 9017d48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,17 @@ public class SenderConfig {
@Value("${spring.kafka.producer.transaction-id-prefix}")
private String transactionIdPrefix;

@Value("${spring.kafka.producer.transaction-timeout}")
private int transactionTimeout;

@Bean
public Map<String, Object> producerConfigs() {
Map<String, Object> props = new HashMap<>();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers);
props.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, StringSerializer.class);
props.put(ProducerConfig.TRANSACTIONAL_ID_CONFIG, transactionIdPrefix);
props.put(ProducerConfig.TRANSACTION_TIMEOUT_CONFIG, transactionTimeout);
return props;
}

Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/application.properties
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ auto.create.topics.enable=false
spring.kafka.producer.key-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.value-serializer=org.apache.kafka.common.serialization.StringSerializer
spring.kafka.producer.transaction-id-prefix=tx-
spring.kafka.consumer.properties.isolation.level= read_committed
spring.kafka.producer.transaction-timeout=1800000

topic.name.target.kbart=bacon.kbart.toload

Expand Down

0 comments on commit 9017d48

Please sign in to comment.