use of com.formkiq.aws.sqs.SqsService in project formkiq-core by formkiq.
the class AbstractRequestHandler method before.
/**
* before.
*
* @throws Exception Exception
*/
@BeforeEach
public void before() throws Exception {
// this.dbhelper = new DynamoDbHelper(TestServices.getDynamoDbConnection(DYNAMODB_PORT));
// this.dbhelper.truncateDocumentsTable();
// this.dbhelper.truncateWebhooks();
// this.dbhelper.truncateConfig();
this.map.put("APP_ENVIRONMENT", TestServices.FORMKIQ_APP_ENVIRONMENT);
this.map.put("DOCUMENTS_TABLE", documentsTable);
this.map.put("CACHE_TABLE", cacheTable);
this.map.put("DOCUMENTS_S3_BUCKET", BUCKET_NAME);
this.map.put("STAGE_DOCUMENTS_S3_BUCKET", STAGE_BUCKET_NAME);
this.map.put("AWS_REGION", AWS_REGION.toString());
this.map.put("DEBUG", "true");
this.map.put("SQS_DOCUMENT_FORMATS", TestServices.getSqsDocumentFormatsQueueUrl());
this.map.put("DISTRIBUTION_BUCKET", "formkiq-distribution-us-east-pro");
this.map.put("FORMKIQ_TYPE", "core");
this.map.put("WEBSOCKET_SQS_URL", TestServices.getSqsWebsocketQueueUrl());
createApiRequestHandler(this.map);
this.awsServices = new CoreRequestHandler().getAwsServices();
SqsService sqsservice = this.awsServices.sqsService();
for (String queue : Arrays.asList(TestServices.getSqsDocumentFormatsQueueUrl())) {
ReceiveMessageResponse response = sqsservice.receiveMessages(queue);
while (response.messages().size() > 0) {
for (Message msg : response.messages()) {
sqsservice.deleteMessage(queue, msg.receiptHandle());
}
response = sqsservice.receiveMessages(queue);
}
}
}
Aggregations