# Removing a message from SQS after BulkProcessor completion

**URL:** <https://discuss.elastic.co/t/removing-a-message-from-sqs-after-bulkprocessor-completion/232983>\
**Category:** Elasticsearch\
**Tags:** language-clients\
**Created:** [May 17, 2020, 10:06am UTC](https://discuss.elastic.co/t/removing-a-message-from-sqs-after-bulkprocessor-completion/232983 "2020-05-17T10:06:05Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jerrymj](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jerrymj/32/71624_2.png) [@jerrymj](https://discuss.elastic.co/u/jerrymj)\
**Post date:** [May 17, 2020, 10:06am UTC](https://discuss.elastic.co/t/removing-a-message-from-sqs-after-bulkprocessor-completion/232983/1 "2020-05-17T10:06:05Z")

</div>

Hi,

I am using the java RestHighLevelClient (6.3) for indexing. I intend to read the data from an SQS and would delete that message from SQS once **successfully indexed**.

I was planning to use the async BulkProcessor for this.

[https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-document-bulk.html#java-rest-high-document-bulk-processor](https://www.elastic.co/guide/en/elasticsearch/client/java-rest/6.3/java-rest-high-document-bulk.html#java-rest-high-document-bulk-processor)

What I could not figure out was that though the **BulkProcessor.Listener** class helps provide helper methods to handle the bulk process:

1. All helper methods return void.
2. I cannot figure out how to get the action response back to the requestor (callee function) - so that i can delete the SQS message (or not in the case of failure).

I have a feeling that I am missing something. Maybe asynchronous processing may not be the solution. I was inclined to use the BulkProcessor as it provided a nice set of configurations - bulkSize, bulkActions, flushInterval, concurrentRequests, etc.

Would there be good examples I could refer to?

Thanks in advance.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [June 14, 2020, 10:06am UTC](https://discuss.elastic.co/t/removing-a-message-from-sqs-after-bulkprocessor-completion/232983/2 "2020-06-14T10:06:17Z")

</div>

Closed on June 14, 2020, 10:06am UTC

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
