Re: Camel AWS-DDB scan/query

2016-04-26 Thread urbanenomad
Sorry was this ever resolved?  I seem to be running into the same issue and
as I dig into the stack I notice that at line 39 and 40 of the class
org.apache.camel.component.aws.ddb.ScanCommand it seems to be over writing
the previous Result headers with the input headers and the only result that
survives is the last result value which is the DdbConstants.SCANNED_COUNT
value.  I can see that my scan call is receiving the items but it gets wiped
out in the outbound headers.

As I dig deeper it seems to be wiped out because the following lines of
code.

---
package org.apache.camel.component.aws.common;

import org.apache.camel.Exchange;
import org.apache.camel.Message;

public final class AwsExchangeUtil {

private AwsExchangeUtil() {
}

public static Message getMessageForResponse(final Exchange exchange) {
if (exchange.getPattern().isOutCapable()) {
Message out = exchange.getOut();
*out.copyFrom(exchange.getIn());*
return out;
}
return exchange.getIn();
}
}
---

The out.copyFrom(exchange.getIn()) method eventually clears the out.headers
which contained the last added header result info from the addToResult
method of the ScanCommand.

I think rather then doing the out.copyFrom, it just returned the out Message
then it would not get wiped and would return all the result information from
the ddb scan call.



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-AWS-DDB-scan-query-tp5749255p5781695.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: AWS-DDB

2014-12-13 Thread Willem Jiang
What’s kind of test mode do you use?
The exception message  is The security token included in the request is 
invalid”, can you double check if your security token is set rightly?

--  
Willem Jiang

Red Hat, Inc.
Web: http://www.redhat.com
Blog: http://willemjiang.blogspot.com (English)
http://jnn.iteye.com (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem



On December 12, 2014 at 10:29:42 PM, Scott Gentry (sgent...@gmail.com) wrote:
 I'm attempting to write some json data to a Dynamo Table with blueprint XML.
  
 While in testing mode I was looking to send data to dynamo local with the
 following snippet:
  
  uri=aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake

 /
  
 However, when this portion of the route is reached, I receive the following
 error:
  
 2014-12-11 17:24:00,354 | ERROR | mix-5.3.0/deploy | BlueprintCamelContext
 | ?? | 124 - org.apache.camel.camel-blueprint - 2.13.2 | Error occurred
 during starting Camel: CamelContext(camel-10) due Failed to create route
 getSchedule at: 
 To[aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake] 
  
  in route: Route(getSchedule)[[From[seda:ingestSchedule]] -
 [Recipient... because of Failed to resolve endpoint:
 aws-ddb://localhost:8000?accessKey=FakesecretKey=FaketableName=schedule  
 due to: The security token included in the request is invalid. (Service:
 AmazonDynamoDB; Status Code: 400; Error Code: UnrecognizedClientException;
 Request ID: 54R236QHN2JR3AIRFLOLCKU0RJVV4KQNSO5AEMVJF66Q9ASUAAJG)
 org.apache.camel.FailedToCreateRouteException: Failed to create route
 getSchedule at: 
 To[aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake] 
  
  in route: Route(getSchedule)[[From[seda:ingestSchedule]] -
 [Recipient... because of Failed to resolve endpoint:
 aws-ddb://localhost:8000?accessKey=FakesecretKey=FaketableName=schedule  
 due to: The security token included in the request is invalid. (Service:
 AmazonDynamoDB; Status Code: 400; Error Code: UnrecognizedClientException;
 Request ID: 54R236QHN2JR3AIRFLOLCKU0RJVV4KQNSO5AEMVJF66Q9ASUAAJG)
  
 From the examples I have seen working with the local DB, the keys do not
 matter, and this should work.
  
 In addition, is there built in support (yet) for working with JSON? I know
 it hasn't been around for very long, and I don't see options which seem to
 indicate it is baked into the endpoint yet.
  
 Respectfully,
  
 Scott
  



Re: AWS-DDB

2014-12-13 Thread Scott Gentry
The documentation surrounding dynamo local claims that the keys do not
matter in the usage notes section:

http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Tools.DynamoDBLocal.html
On Dec 13, 2014 9:40 AM, Willem Jiang willem.ji...@gmail.com wrote:

 What’s kind of test mode do you use?
 The exception message  is The security token included in the request is
 invalid”, can you double check if your security token is set rightly?

 --
 Willem Jiang

 Red Hat, Inc.
 Web: http://www.redhat.com
 Blog: http://willemjiang.blogspot.com (English)
 http://jnn.iteye.com (Chinese)
 Twitter: willemjiang
 Weibo: 姜宁willem



 On December 12, 2014 at 10:29:42 PM, Scott Gentry (sgent...@gmail.com)
 wrote:
  I'm attempting to write some json data to a Dynamo Table with blueprint
 XML.
 
  While in testing mode I was looking to send data to dynamo local with the
  following snippet:
 
  
 uri=aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake
  /
 
  However, when this portion of the route is reached, I receive the
 following
  error:
 
  2014-12-11 17:24:00,354 | ERROR | mix-5.3.0/deploy |
 BlueprintCamelContext
  | ?? | 124 - org.apache.camel.camel-blueprint - 2.13.2 | Error occurred
  during starting Camel: CamelContext(camel-10) due Failed to create route
  getSchedule at: 
 
 To[aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake]
   in route: Route(getSchedule)[[From[seda:ingestSchedule]] -
  [Recipient... because of Failed to resolve endpoint:
  aws-ddb://localhost:8000?accessKey=FakesecretKey=FaketableName=schedule
  due to: The security token included in the request is invalid. (Service:
  AmazonDynamoDB; Status Code: 400; Error Code:
 UnrecognizedClientException;
  Request ID: 54R236QHN2JR3AIRFLOLCKU0RJVV4KQNSO5AEMVJF66Q9ASUAAJG)
  org.apache.camel.FailedToCreateRouteException: Failed to create route
  getSchedule at: 
 
 To[aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake]
   in route: Route(getSchedule)[[From[seda:ingestSchedule]] -
  [Recipient... because of Failed to resolve endpoint:
  aws-ddb://localhost:8000?accessKey=FakesecretKey=FaketableName=schedule
  due to: The security token included in the request is invalid. (Service:
  AmazonDynamoDB; Status Code: 400; Error Code:
 UnrecognizedClientException;
  Request ID: 54R236QHN2JR3AIRFLOLCKU0RJVV4KQNSO5AEMVJF66Q9ASUAAJG)
 
  From the examples I have seen working with the local DB, the keys do not
  matter, and this should work.
 
  In addition, is there built in support (yet) for working with JSON? I
 know
  it hasn't been around for very long, and I don't see options which seem
 to
  indicate it is baked into the endpoint yet.
 
  Respectfully,
 
  Scott
 




AWS-DDB

2014-12-12 Thread Scott Gentry
I'm attempting to write some json data to a Dynamo Table with blueprint XML.

While in testing mode I was looking to send data to dynamo local with the
following snippet:

to
uri=aws-ddb://localhost:8000?tableName=scheduleamp;accessKey=Fakeamp;secretKey=Fake
/

However, when this portion of the route is reached, I receive the following
error:

2014-12-11 17:24:00,354 | ERROR | mix-5.3.0/deploy | BlueprintCamelContext
 | ?? | 124 - org.apache.camel.camel-blueprint - 2.13.2 | Error occurred
during starting Camel: CamelContext(camel-10) due Failed to create route
getSchedule at: 
To[aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake]
 in route: Route(getSchedule)[[From[seda:ingestSchedule]] -
[Recipient... because of Failed to resolve endpoint:
aws-ddb://localhost:8000?accessKey=FakesecretKey=FaketableName=schedule
due to: The security token included in the request is invalid. (Service:
AmazonDynamoDB; Status Code: 400; Error Code: UnrecognizedClientException;
Request ID: 54R236QHN2JR3AIRFLOLCKU0RJVV4KQNSO5AEMVJF66Q9ASUAAJG)
org.apache.camel.FailedToCreateRouteException: Failed to create route
getSchedule at: 
To[aws-ddb://localhost:8000?tableName=scheduleaccessKey=FakesecretKey=Fake]
 in route: Route(getSchedule)[[From[seda:ingestSchedule]] -
[Recipient... because of Failed to resolve endpoint:
aws-ddb://localhost:8000?accessKey=FakesecretKey=FaketableName=schedule
due to: The security token included in the request is invalid. (Service:
AmazonDynamoDB; Status Code: 400; Error Code: UnrecognizedClientException;
Request ID: 54R236QHN2JR3AIRFLOLCKU0RJVV4KQNSO5AEMVJF66Q9ASUAAJG)

From the examples I have seen working with the local DB, the keys do not
matter, and this should work.

In addition, is there built in support (yet) for working with JSON? I know
it hasn't been around for very long, and I don't see options which seem to
indicate it is baked into the endpoint yet.

Respectfully,

Scott


Re: Camel AWS-DDB scan/query

2014-04-07 Thread dev1
Thanks a lot for an answer!
I checked once more the documentation and still didn't get correct response.
I'm setting up the filter and - no answer. Headers I set:
CamelAwsDdbScanFilter, CamelAwsDdbAttributeNames
Does the scanning really work for camel? 

Patty



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-AWS-DDB-scan-query-tp5749255p5749888.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: Camel AWS-DDB scan/query

2014-04-02 Thread Bilgin Ibryam
The AmazonDynamoDB class used by Camel is deprecated, it might not support
all the new features offered by DDB.

The features offered by the camel component that can help you are: query
and scan. These operations call respectively the following methods of
AmazonDynamoDB:

public QueryResult query(QueryRequest queryRequest)

public ScanResult scan(ScanRequest scanRequest)


You can check the AWS API and see for yourself how to achieve what you want.

HTH,




On 23 March 2014 13:38, dev1 jo...@wp.pl wrote:

 Hello,
 I'm using Camel AWS-DDB for the first time and have some issues getting
 data
 from DynamoDB.

 Could you, please, help me with this? I'm able to add some item, update by
 primary Hash/Range key (by defining Key object) but is it possible to do it
 by database indexes?
 I created some indexes on database with Hash/Range keys defined and could
 not find any example of using them in camel. Is it possible to Query/Scan
 db
 by indexes? How can I get list of items by value of some other field? I
 tried CamelAwsDdbScanFilter but without success.
 Could you give me some examples of querying/scanning dynamoDB?

 Thanks in advance



 --
 View this message in context:
 http://camel.465427.n5.nabble.com/Camel-AWS-DDB-scan-query-tp5749255.html
 Sent from the Camel - Users mailing list archive at Nabble.com.




-- 
Bilgin Ibryam

Apache Camel  Apache OFBiz committer
Blog: ofbizian.com
Twitter: @bibryam https://twitter.com/bibryam

Author of Instant Apache Camel Message Routing
http://www.amazon.com/dp/1783283475


Re: Camel AWS-DDB scan/query

2014-03-24 Thread dev1
Could anybody help me with that?



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-AWS-DDB-scan-query-tp5749255p5749271.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Camel AWS-DDB scan/query

2014-03-23 Thread dev1
Hello,
I'm using Camel AWS-DDB for the first time and have some issues getting data
from DynamoDB.

Could you, please, help me with this? I'm able to add some item, update by
primary Hash/Range key (by defining Key object) but is it possible to do it
by database indexes? 
I created some indexes on database with Hash/Range keys defined and could
not find any example of using them in camel. Is it possible to Query/Scan db
by indexes? How can I get list of items by value of some other field? I
tried CamelAwsDdbScanFilter but without success. 
Could you give me some examples of querying/scanning dynamoDB? 

Thanks in advance



--
View this message in context: 
http://camel.465427.n5.nabble.com/Camel-AWS-DDB-scan-query-tp5749255.html
Sent from the Camel - Users mailing list archive at Nabble.com.