Skip to content

Commit

Permalink
Refinements
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed Dec 3, 2024
1 parent 215339e commit fc17f35
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -163,14 +163,14 @@ public void test() {
throw new ConnectorException("No Kafka producer configured");
}
try {
producer.clientInstanceId(Duration.ofSeconds(10));
producer.metrics();
} catch (Exception e) {
LOG.error(e, "While testing Kafka producer");
throw new ConnectionFailedException(e);
}

try (KafkaConsumer<String, Object> consumer = createConsumer(ObjectClass.ACCOUNT)) {
consumer.clientInstanceId(Duration.ofSeconds(10));
consumer.listTopics(Duration.ofSeconds(10));
} catch (Exception e) {
LOG.error(e, "While testing Kafka consumer");
throw new ConnectionFailedException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#

kafka.connector.display=Kafka Connector
bootstrapServers.display=Sample Property
bootstrapServers.help=Only a sample property
bootstrapServers.display=Bootstrap servers
bootstrapServers.help=A list of host/port pairs used to establish the initial connection to the Kafka cluster
clientId.display=Client id
clientId.help=Client id for subscription
autoOffsetReset.display=Auto offset reset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
#

kafka.connector.display=Connettore Kafka
bootstrapServers.display=Propriet\u00e0 d'esempio
bootstrapServers.help=Solo una propriet\u00e0 d'esempio
bootstrapServers.display=Server di bootstrap
bootstrapServers.help=Un elenco di coppie host/porta utilizzate per stabilire la connessione iniziale al cluster Kafka
clientId.display=Id client
clientId.help=Id client per sottoscrizione
autoOffsetReset.display=Reset auto offset
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.ArrayList;
import java.util.List;
Expand Down Expand Up @@ -102,6 +103,13 @@ void delete() {

@Test
void livesync() throws InterruptedException, ExecutionException {
List<LiveSyncDelta> deltas = new ArrayList<>();
newFacade().livesync(
ObjectClass.GROUP,
deltas::add,
new OperationOptionsBuilder().build());
assertTrue(deltas.isEmpty());

// create a producer and send a new event
Properties props = new Properties();
props.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, KAFKA_CONTAINER.getBootstrapServers());
Expand All @@ -115,7 +123,7 @@ void livesync() throws InterruptedException, ExecutionException {
}

// live sync
List<LiveSyncDelta> deltas = new ArrayList<>();
deltas.clear();
await().atMost(5, TimeUnit.SECONDS).pollInterval(1, TimeUnit.SECONDS).until(() -> {
newFacade().livesync(
ObjectClass.GROUP,
Expand Down

0 comments on commit fc17f35

Please sign in to comment.