Andrea Cosentino created CAMEL-24764:
----------------------------------------

             Summary: camel-huaweicloud-obs: close the downloaded object stream 
(connection leak) and fix putObject bucket-creation, charset and proxy-port 
issues
                 Key: CAMEL-24764
                 URL: https://issues.apache.org/jira/browse/CAMEL-24764
             Project: Camel
          Issue Type: Bug
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino


Several functional issues in camel-huaweicloud-obs, found by a gap audit (all 
verified against main):

* HIGH: OBSUtils.mapObsObject downloads the object via 
toBytes(obsObject.getObjectContent()) but toBytes uses IOHelper.copy, which 
does NOT close its input. The Huawei SDK content stream holds a pooled HTTP 
connection, so every producer getObject and every consumer-polled object leaks 
a connection, eventually exhausting the pool on a long-running consumer. Fix: 
close the content stream (try-with-resources / copyAndCloseInput).
* MED: OBSProducer.putObject creates the bucket when missing but calls 
OBSRegion.checkValidRegion(bucketLocation) without defaulting an empty 
location, unlike createBucket which defaults to DEFAULT_LOCATION first; 
putObject into a not-yet-existing bucket without bucketLocation fails with a 
confusing empty-regionId error. Fix: mirror createBucket default.
* LOW: OBSProducer download debug log passes bucketLocation where bucketName is 
meant (logs from bucket null).
* LOW: OBSProducer uploads a String body with the platform-default charset; use 
UTF-8.
* LOW: the proxy guard uses ObjectHelper.isNotEmpty(getProxyPort()) on a 
primitive int (always true), so proxyHost set with proxyPort omitted configures 
a proxy on port 0. Fix: getProxyPort() > 0.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to