Conversation
…of the dynamodb client
|
You could write it a little more compactly like: (defn- db-client*
"Get a AmazonDynamoDBClient instance for the supplied credentials."
[{:keys [access-key secret-key endpoint proxy-host proxy-port]}]
(let [aws-creds (BasicAWSCredentials. access-key secret-key)
client-config (ClientConfiguration.)]
(when proxy-host (.setProxyHost client-config proxy-host))
(when proxy-port (.setProxyPort client-config proxy-port))
(let [client (AmazonDynamoDBClient. aws-creds client-config)]
(when endpoint (.setEndpoint client endpoint))
client)))Since: (AmazonDynamoDBClient. aws-creds)Is equivalent to: (AmazonDynamoDBClient. aws-creds (ClientConfiguration.)) |
Added proxy-host and proxy-port keys to the credential map and to the db-client* fn.
|
Excellent suggestion. I made the changes. I do believe it's important to test for both proxy-host and proxy-port, otherwise ClientConfiguration will be incomplete if one of the values is missing. |
|
Why is it a bad thing if ClientConfiguration is incomplete? It's generally better to fail noisily, and I'd prefer an exception over a silent failure. |
|
Got it. I made proxy-host and proxy-port independent of each other. |
|
Could you squash your commits? Then I'll merge. |
…of the dynamodb client
…into proxy-support
|
It took me a litte while to find out how to squash commits that have already been pushed. I hope I did it right. Let me know. |
|
I'm afraid you haven't done it right. Run the following command: This will open up an editor with an interactive rebase. Use the editor to change all but one commit to be squashed. Once you've done that, you should end up with just one commit ahead of master. You can use In order to push the commits, run: The |
|
I'm sorry but I cannot seem to find a way to do that. It appears like the commits have already been squashed and pushed to the branch. If you prefer, I can create a new branch, put a single commit there and then create a new pull request from it. Thank you for being this patient. |
I'm adding proxy support to the creation of the DynamoDB client.
In the credential map two new keys :proxy-host and :proxy-port can be specified. If they exist, a ClientConfiguration instance is added to the constructor of the AmazonDynamoDB object.
E.g.:
{:access-key "AAA" :secret-key "ZZZ" :proxy-host "proxy-us.intel.com" :proxy-port 911}