Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A few cleanup (unused constants and use expression lambdas) #849

Merged
merged 1 commit into from
Nov 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -148,9 +148,7 @@ public void doGetTopic(RoutingContext routingContext) {
}
TopicDescription description = topicDescriptions.get(topicName);
if (description != null) {
description.partitions().forEach(partitionInfo -> {
partitionsArray.add(createPartitionMetadata(partitionInfo));
});
description.partitions().forEach(partitionInfo -> partitionsArray.add(createPartitionMetadata(partitionInfo)));
}
root.set("partitions", partitionsArray);
HttpUtils.sendResponse(routingContext, HttpResponseStatus.OK.code(), BridgeContentType.KAFKA_JSON, JsonUtils.jsonToBytes(root));
Expand Down
10 changes: 3 additions & 7 deletions src/main/java/io/strimzi/kafka/bridge/http/HttpBridge.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ private CorsHandler getCorsHandler() {
}

@Override
public void stop(Promise<Void> stopPromise) throws Exception {
public void stop(Promise<Void> stopPromise) {

log.info("Stopping HTTP-Kafka bridge verticle ...");

Expand Down Expand Up @@ -474,9 +474,7 @@ private void processProducer(RoutingContext routingContext) {
source = new HttpSourceBridgeEndpoint<>(this.bridgeConfig, contentTypeToFormat(contentType),
new ByteArraySerializer(), new ByteArraySerializer());

source.closeHandler(s -> {
this.httpBridgeContext.getHttpSourceEndpoints().remove(httpServerRequest.connection());
});
source.closeHandler(s -> this.httpBridgeContext.getHttpSourceEndpoints().remove(httpServerRequest.connection()));
source.open();
this.httpBridgeContext.getHttpSourceEndpoints().put(httpServerRequest.connection(), source);
}
Expand Down Expand Up @@ -613,9 +611,7 @@ private void errorHandler(RoutingContext routingContext) {
}

private void processConnection(HttpConnection httpConnection) {
httpConnection.closeHandler(close -> {
closeConnectionEndpoint(httpConnection);
});
httpConnection.closeHandler(close -> closeConnectionEndpoint(httpConnection));
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,4 @@ public final class TracingConstants {
public static final String OPENTELEMETRY_SERVICE_NAME_ENV_KEY = "OTEL_SERVICE_NAME";
/** OpenTelemetry service name system property */
public static final String OPENTELEMETRY_SERVICE_NAME_PROPERTY_KEY = "otel.service.name";
/** OpenTelemetry traces exporter env var */
public static final String OPENTELEMETRY_TRACES_EXPORTER_ENV_KEY = "OTEL_TRACES_EXPORTER";
/** OpenTelemetry traces exporter system property */
public static final String OPENTELEMETRY_TRACES_EXPORTER_PROPERTY_KEY = "otel.traces.exporter";
}