Skip to content

Commit

Permalink
#384 merge
Browse files Browse the repository at this point in the history
  • Loading branch information
jemacineiras committed Nov 16, 2023
1 parent d0e48dc commit 55863cb
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 2 additions & 4 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,8 @@ Now that you know what KLoadGen is and that you are familiar with its components

You will need these tools to start using the plugin:

- JDK/JRE 11+
- (17 recommended)
- JMeter 5.4+
- (5.6.2 recommended)
- JDK/JRE 17+
- JMeter 5.6.2+
- Maven

## Quickstart
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,22 @@ public static Pair<String, List<FieldValueMapping>> flatPropertiesList(final Str
final String registryName = properties.getProperty(SchemaRegistryKeyHelper.SCHEMA_REGISTRY_NAME);
final AbstractParsedSchemaAdapter abstractParsedSchemaAdapter = schemaParsed.getParsedSchemaAdapter();
final String schemaType = abstractParsedSchemaAdapter.getType();
final AbstractParsedSchemaAdapter parsedSchemaAdapter = schemaParsed.getParsedSchemaAdapter();
final String schemaType = parsedSchemaAdapter.getType();

final List<FieldValueMapping> attributeList = new ArrayList<>();
final SchemaRegistryEnum schemaRegistryEnum = SchemaRegistryEnum.valueOf(registryName.toUpperCase());

final Object schema;
//TODO change parser
schema = switch (schemaRegistryEnum) {
case APICURIO -> ((ApicurioAbstractParsedSchemaMetadata) abstractParsedSchemaAdapter).getSchema();
case CONFLUENT -> abstractParsedSchemaAdapter.getRawSchema();
};
attributeList.addAll(getExtractor(schemaType).processSchema(schema, schemaRegistryEnum));
if (Objects.nonNull(registryName)) {
//TODO change parser
schema = switch (schemaRegistryEnum) {
case APICURIO -> ((ApicurioAbstractParsedSchemaMetadata) parsedSchemaAdapter).getSchema();
case CONFLUENT -> parsedSchemaAdapter.getRawSchema();
default -> throw new KLoadGenException("Schema Registry Type nos supported " + registryName.toUpperCase());
};
attributeList = getExtractor(schemaType, registryName.toUpperCase()).processSchema(schema, schemaRegistryEnum);
}
return Pair.of(schemaType, attributeList);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,12 @@ public String getSchemaRegistryUrlKey() {

@Override
public void setSchemaRegistryClient(final String url, final Map<String, ?> properties) {
log.debug("CREATEION");
this.schemaRegistryClient = new CachedSchemaRegistryClient(List.of(checkPropertyOrVariable(url)), 1000,
List.of(new AvroSchemaProvider(), new JsonSchemaProvider(), new ProtobufSchemaProvider()), properties);
}

@Override
public void setSchemaRegistryClient(final Map<String, ?> properties) {
log.debug("CREATITIN");
final String url = properties.get(this.getSchemaRegistryUrlKey()).toString();
this.schemaRegistryClient = new CachedSchemaRegistryClient(List.of(checkPropertyOrVariable(url)), 1000,
List.of(new AvroSchemaProvider(), new JsonSchemaProvider(), new ProtobufSchemaProvider()), properties);
Expand Down

0 comments on commit 55863cb

Please sign in to comment.