Saravanakumar Selvaraj created CAMEL-27350:
----------------------------------------------

             Summary: camel-alibaba-mns: the producer requires the AccessKey 
pair when the mnsClient option is set
                 Key: CAMEL-27350
                 URL: https://issues.apache.org/jira/browse/CAMEL-27350
             Project: Camel
          Issue Type: Bug
    Affects Versions: 4.23.0
            Reporter: Saravanakumar Selvaraj


Found while reviewing the descriptions of camel-alibaba-mns for CAMEL-23832.

The producer fails without an AccessKey pair, also when the mnsClient option is 
set or autowired. It does not need the pair then, because it sends its requests 
with that client.

- MNSProducer.process calls MNSUtils.createClientConfigurations for each 
exchange.
- createClientConfigurations calls resolveAccessKey and resolveSecretKey. Each 
throws an IllegalArgumentException when neither its option nor serviceKeys has 
a value.
- The producer never reads the accessKey, secretKey, region, and 
accountEndpoint of the ClientConfigurations.

What a route gets, with mnsClient set and no accessKey: each exchange of the 
producer fails. The message is "authentication parameter 'access key (AK)' not 
found". The consumer of such an endpoint works, because it does not call 
createClientConfigurations.

No test runs the producer with a set client and without the AccessKey pair. 
Each test that runs the producer sets both keys next to the mock client.

Proposed change: the producer no longer resolves the AccessKey pair for an 
exchange. A new test sends a message with a mock client and without the keys. 
The descriptions of accessKey, secretKey, serviceKeys, and mnsClient can then 
say that the pair is not used with a set client.

_Claude Code on behalf of saravanakumar1987_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to