use of org.apache.kafka.common.message.IncrementalAlterConfigsRequestData.AlterConfigsResource in project kafka by apache.
the class IncrementalAlterConfigsRequest method getErrorResponse.
@Override
public AbstractResponse getErrorResponse(final int throttleTimeMs, final Throwable e) {
IncrementalAlterConfigsResponseData response = new IncrementalAlterConfigsResponseData();
ApiError apiError = ApiError.fromThrowable(e);
for (AlterConfigsResource resource : data.resources()) {
response.responses().add(new AlterConfigsResourceResponse().setResourceName(resource.resourceName()).setResourceType(resource.resourceType()).setErrorCode(apiError.error().code()).setErrorMessage(apiError.message()));
}
return new IncrementalAlterConfigsResponse(response);
}
use of org.apache.kafka.common.message.IncrementalAlterConfigsRequestData.AlterConfigsResource in project kafka by apache.
the class RequestResponseTest method createIncrementalAlterConfigsRequest.
private IncrementalAlterConfigsRequest createIncrementalAlterConfigsRequest(short version) {
IncrementalAlterConfigsRequestData data = new IncrementalAlterConfigsRequestData();
AlterableConfig alterableConfig = new AlterableConfig().setName("retention.ms").setConfigOperation((byte) 0).setValue("100");
IncrementalAlterConfigsRequestData.AlterableConfigCollection alterableConfigs = new IncrementalAlterConfigsRequestData.AlterableConfigCollection();
alterableConfigs.add(alterableConfig);
data.resources().add(new AlterConfigsResource().setResourceName("testtopic").setResourceType(ResourceType.TOPIC.code()).setConfigs(alterableConfigs));
return new IncrementalAlterConfigsRequest.Builder(data).build(version);
}
Aggregations