Andrea Cosentino created CAMEL-24517:
----------------------------------------

             Summary: camel-ibm-cos: headBucket does not set the BucketExists 
producer header
                 Key: CAMEL-24517
                 URL: https://issues.apache.org/jira/browse/CAMEL-24517
             Project: Camel
          Issue Type: Bug
            Reporter: Andrea Cosentino
            Assignee: Andrea Cosentino
             Fix For: 4.23.0


The headBucket operation of IBMCOSProducer computes whether the bucket exists 
and sets it as the message body, but never sets the CamelIBMCOSBucketExists 
header (IBMCOSConstants.BUCKET_EXISTS), even though that header is declared as 
a producer @Metadata header. A route that reads the CamelIBMCOSBucketExists 
header after a headBucket call therefore gets null.

{code:java}
boolean exists = cosClient.doesBucketExistV2(bucketName);
Message message = getMessageForResponse(exchange);
message.setBody(exists);
// BUCKET_EXISTS header never set
{code}

Fix: set the BUCKET_EXISTS header from the computed value.

Affected: components/camel-ibm/camel-ibm-cos 
(org.apache.camel.component.ibm.cos.IBMCOSProducer.headBucket).



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

Reply via email to