Skip to main content
Inspiring
May 28, 2021
Question

CF2021 AWS SNS Error: "The httpClient and the httpClientBuilder can't both be configured."

  • May 28, 2021
  • 3 replies
  • 858 views

I'm getting errors using some of the sample code (after adjusting for typos): https://helpx.adobe.com/coldfusion/using/integrate-coldfusion-amazon-sns.html

 

<cfscript>

//'archinet_aws_user_1' and 'snsConf' are aliases configured in the CFAdmin panel
// define the credential and the configuration aliases in the ColdFusion Admin
sns=getCloudService("archinet_aws_user_1","snsConf");
// code below.
</cfscript>

 

Throws this error:

"The httpClient and the httpClientBuilder can't both be configured."

 

Any one else encounter this?

    This topic has been closed for replies.

    3 replies

    Inspiring
    June 10, 2021

    This is a bug. We had the same issue and raised it with Adobe.

     

    Seems SNS doesnt work at all out of the box.

     

    https://tracker.adobe.com/#/view/CF-4211954

     

    TwoEdgeAuthor
    Inspiring
    June 24, 2021

    Glad to have a confirmation on that one!

    BKBK
    Community Expert
    Community Expert
    June 24, 2021

    The ticket says that Adobe has fixed it. If this is urgent to you, request a hot fix from them: cfinstal|at|adobe.com

    TwoEdgeAuthor
    Inspiring
    June 3, 2021

    How do I file this as bug?

    BKBK
    Community Expert
    Community Expert
    June 3, 2021
    quote

    How do I file this as bug?


    By @TwoEdge

    https://tracker.adobe.com

    BKBK
    Community Expert
    Community Expert
    May 30, 2021

    If the aliases (string arguments) don't work, then try using the credential and config defined in Application.cfc (struct arguments).

    TwoEdgeAuthor
    Inspiring
    June 1, 2021

    Thanks for responding.  I didn't post it, but no matter what variation I try to do it it still fails with the same error.  

    For example:

    <cfscript>
    snsCred={
        "vendorName":"AWS",
        "alias": "snsCredAlias",
        "region":"us-east-1",
        "accessKeyId": "xxxxxxxxxxxxxxxxxxxx",
        "secretAccessKey": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      }
    snsConf = {
                "alias":"snsConfAlias",
                "serviceName" : "SNS",
                "clientOverrideConfig":{
                    "retryPolicy":{
                      "numRetries":4
                    }
                },
                "httpClientConfig":{
                    "maxConnections":50
                }
      
        }
    
    try{
        snsObj = getCloudService(snsCred, snsConf);    
        }
    catch(any excpt){
            writeDump(var="#excpt#", format="html", abort="true");
            //Throws: The httpClient and the httpClientBuilder can't both be configured.
        }
    
    </cfscript>
     
    Here is an excerpt from the stack trace:
    java.lang.IllegalArgumentException: The httpClient and the httpClientBuilder can't both be configured. at software.amazon.awssdk.utils.Validate.isTrue(Validate.java:76) at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.resolveSyncHttpClient(SdkDefaultClientBuilder.java:240) at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.finalizeSyncConfiguration(SdkDefaultClientBuilder.java:210) at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.syncClientConfiguration(SdkDefaultClientBuilder.java:148) at software.amazon.awssdk.services.sns.DefaultSnsClientBuilder.buildClient(DefaultSnsClientBuilder.java:27) at software.amazon.awssdk.services.sns.DefaultSnsClientBuilder.buildClient(DefaultSnsClientBuilder.java:22) at software.amazon.awssdk.core.client.builder.SdkDefaultClientBuilder.build(SdkDefaultClientBuilder.java:119) at coldfusion.cloud.aws.sns.SNSClientImpl.<init>(SNSClientImpl.java:132) at coldfusion.cloud.aws.sns.producer.SNSProducer.getServiceHandle(SNSProducer.java:48) at coldfusion.cloud.aws.sns.producer.SNSProducer.getServiceHandle(SNSProducer.java:36) at coldfusion.cloud.CloudServiceAgent.getCloudService(CloudServiceAgent.java:35
     
    Any thoughts? Has anyone actually tried this besides me and gotten it to work?