Recently, I had a question about AWS and Camel , but finally I made my way. Now the application works, however I get a very strange exception.
First of all, my application is divided into two instances of EC2. One copy gets the ISBN of the top 10 books from Amazon's RSS feed and stores it in. Here is a snippet of code.
public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from( "rss:http://www.amazon.de/gp/rss/bestsellers/books/ref=zg_bs_books_rsslink?splitEntries=false") .split() .method("RssSplitter", "split") .process(new Dummy()) .setProperty("isbn", simple("${body}")) .to("aws-sqs://bookz_sqs?accessKey=acceskey&secretKey=secretKey"); } }); context.start(); Thread.sleep(10000); context.stop(); }
The second copy is responsible for reading SQS as the first operation, and finally gets additional information about the book from other libraries in the WWW, which is not a problem, and finally create an RSS feed, which was also not a problem.
public static void main(String[] args) throws Exception { CamelContext context = new DefaultCamelContext(); context.addRoutes(new RouteBuilder() { public void configure() { from("aws-sqs://bookz_sqs" + "?accessKey=accessKey" + "&secretKey=secretKey").process(new DynamicIsbnEnrich()).process( new DynamicIsbndbEnrich()).process(new DynamicOpLibEnrich()).setHeader(S3Constants.KEY, simple("${property.isbn}")).to( "aws-s3://bookz" + "?accessKey=accesKey" + "&secretKey=secretKEy" + "®ion=eu-west-1"); } }); context.start(); Thread.sleep(10000); context.stop(); }
Currently, the problem is a strange exception that I donβt understand, and in addition, SQS does NOT delete messages from my queue, however api sais that deleteAfter Read is set to true by default.
2012-12-17 19: 45: 08,335 [Camel (camel-1) thread # 0 - aws-sqs: // team09bookz_sqs] WARN org.apache.camel.component.aws.sqs.SqsConsumer - An error occurred while deleting the message .. Reason: [com.amazonaws.AmazonServiceException - the request must contain the MessageHandle parameter.] Status code: 400, AWS Service: AmazonSQS, AWS Request ID: 0655aa05-ad6f-5571-a83d-e34cc7196343, AWS Error code: MissingParameter, AWS Message error message: The request must contain the MessageHandle parameter.
The application works, but I canβt delete any messages in the queue, and I donβt know why, do I need additional security credentials?
Anyway thanks for the help