use of io.confluent.kafka.schemaregistry.client.rest.entities.requests.ConfigUpdateRequest in project schema-registry by confluentinc.
the class SchemaRegistryPerformance method init.
protected void init() throws Exception {
// No compatibility verification
ConfigUpdateRequest request = new ConfigUpdateRequest();
request.setCompatibilityLevel(CompatibilityLevel.NONE.name);
restService.updateConfig(request, null);
}
use of io.confluent.kafka.schemaregistry.client.rest.entities.requests.ConfigUpdateRequest in project schema-registry by confluentinc.
the class KafkaSchemaRegistry method forwardUpdateCompatibilityLevelRequestToLeader.
private void forwardUpdateCompatibilityLevelRequestToLeader(String subject, CompatibilityLevel compatibilityLevel, Map<String, String> headerProperties) throws SchemaRegistryRequestForwardingException {
UrlList baseUrl = leaderRestService.getBaseUrls();
ConfigUpdateRequest configUpdateRequest = new ConfigUpdateRequest();
configUpdateRequest.setCompatibilityLevel(compatibilityLevel.name);
log.debug(String.format("Forwarding update config request %s to %s", configUpdateRequest, baseUrl));
try {
leaderRestService.updateConfig(headerProperties, configUpdateRequest, subject);
} catch (IOException e) {
throw new SchemaRegistryRequestForwardingException(String.format("Unexpected error while forwarding the update config request %s to %s", configUpdateRequest, baseUrl), e);
} catch (RestClientException e) {
throw new RestException(e.getMessage(), e.getStatus(), e.getErrorCode(), e);
}
}
use of io.confluent.kafka.schemaregistry.client.rest.entities.requests.ConfigUpdateRequest in project schema-registry by confluentinc.
the class RestService method updateCompatibility.
public ConfigUpdateRequest updateCompatibility(String compatibility, String subject) throws IOException, RestClientException {
ConfigUpdateRequest request = new ConfigUpdateRequest();
request.setCompatibilityLevel(compatibility);
return updateConfig(request, subject);
}
use of io.confluent.kafka.schemaregistry.client.rest.entities.requests.ConfigUpdateRequest in project schema-registry by confluentinc.
the class RestService method updateConfig.
/**
* On success, this api simply echoes the request in the response.
*/
public ConfigUpdateRequest updateConfig(Map<String, String> requestProperties, ConfigUpdateRequest configUpdateRequest, String subject) throws IOException, RestClientException {
String path = subject != null ? UriBuilder.fromPath("/config/{subject}").build(subject).toString() : "/config";
ConfigUpdateRequest response = httpRequest(path, "PUT", configUpdateRequest.toJson().getBytes(StandardCharsets.UTF_8), requestProperties, UPDATE_CONFIG_RESPONSE_TYPE_REFERENCE);
return response;
}
Aggregations