Skip to content

[Bug]: Solace BrokerResponse leaks the SEMP HTTP response content stream #39403

Description

@PDGGK

What happened?

In the Solace IO connector, org.apache.beam.sdk.io.solace.broker.BrokerResponse reads the SEMP HTTP response body but never closes the underlying InputStream:

public BrokerResponse(int responseCode, String message, @Nullable InputStream content) {
  ...
  if (content != null) {
    this.content =
        new BufferedReader(new InputStreamReader(content, StandardCharsets.UTF_8))
            .lines()
            .collect(Collectors.joining("\n"));
  }
}

BrokerResponse.fromHttpResponse(HttpResponse) feeds response.getContent() into this constructor, and SempBasicAuthClientExecutor (getQueueResponse / createQueueResponse / createSubscriptionResponse) never calls response.disconnect() nor closes the stream elsewhere. As a result, every SEMP request leaks the HTTP response content stream / connection.

Expected behaviour

The response body stream should be closed once it has been read.

Component

io-java-solace

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions