title: Apache Camel with AWS DynamoDB (aws-ddb) URI parameters
body: <p>I'm trying to route messages from AWS SQS to AWS Dynamo DB using Apache Camel using the following route definition:</p>
  
  <pre><code>&lt;camelContext id="camel" xmlns="http://camel.apache.org/schema/spring"&gt;
      &lt;route&gt;
          &lt;from uri="aws-sqs://my_queue?accessKey=${aKey}&amp;amp;secretKey=RAW(${sKey})&amp;amp;maxMessagesPerPoll=10&amp;amp;deleteAfterRead=true"/&gt;
          &lt;unmarshal&gt;
              &lt;camel:json library="Jackson"/&gt;
          &lt;/unmarshal&gt;
  
          &lt;to uri="aws-ddb:my_table?accessKey=${aKey}&amp;amp;secretKey=RAW(${sKey})&amp;amp;readCapacity=15&amp;amp;writeCapacity=100&amp;amp;operation=PutItem"/&gt;
  
      &lt;/route&gt;
  &lt;/camelContext&gt;
  </code></pre>
  
  <p>But on execution Camel complains that the Dynamo Db URI is missing some required parameters:</p>
  
  <pre><code>org.apache.camel.ResolveEndpointFailedException: Failed to resolve endpoint: aws-ddb://table?amazonDDBClient=%23ddbClient&amp;amazonDdbEndpoint=ap-southeast-2&amp;readCapacity=10&amp;writeCapacity=10 due to: Status Code: 400, AWS Service: AmazonDynamoDB, AWS Request ID: KHA79STK78SHC2BG2R8HLPF7RJVV4KQNSO5AEMVJF66Q9ASUAAJG, AWS Error Code: ValidationException, AWS Error Message: 2 validation errors detected: Value null at 'keySchema.hashKeyElement.attributeName' failed to satisfy constraint: Member must not be null; Value null at 'keySchema.hashKeyElement.attributeType' failed to satisfy constraint: Member must not be null
  </code></pre>
  
  <p>The fun part is, these 2 parameters are not described anywhere in <a href="http://camel.apache.org/aws-ddb.html" rel="nofollow">Camel DDB doc</a>. I spent some time browsing the Camel source and found 2 undocumented URI parameters: keyAttributeName &amp; keyAttributeType, which worked perfectly for me. (I hope this find of mine helps someone as well).</p>
  
  <p>Now even more fun is that these should not be requested for inserting items into Dynamo DB, but I can no longer reproduce this error when I remove the 2 undocumented params from the URI.</p>
  
  <p>So my questions are: </p>
  
  <ol>
  <li>Why did AWS request hash key data for PutItem requests?</li>
  <li>Why can't I reproduce this behaviour any longer?</li>
  </ol>
  
  <p>I could not find any hints either in Camel or AWS documentation, googling only uncovers a handful of irrelevant results.</p>