Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ISSUE-70 Send all the failed message to the error reporter topic #69

Merged
merged 1 commit into from
May 31, 2024

Conversation

maniskum
Copy link
Contributor

@maniskum maniskum commented May 22, 2024

Send all the failed message to the error reporter topic and throw exception

Summary

1-2 line summary of changes

Related Issue

Changes

Please enter each change as a new bullet point

Relevant Documentation

Please enter the links of any docs updated to reflect this change

How Has This Been Tested?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have signed the Adobe Open Source CLA.
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@vivetiwa vivetiwa self-requested a review May 27, 2024 03:47
@maniskum maniskum force-pushed the PLAT-188185 branch 2 times, most recently from 9e5b5b4 to 8d3014c Compare May 27, 2024 19:21
vivetiwa
vivetiwa previously approved these changes May 28, 2024
Copy link
Collaborator

@vivetiwa vivetiwa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM! Few minor comments.

if (Objects.nonNull(errorReporter)) {
final int responseCode = messageResponse.get(STATUS_KEY).asInt();
errorReporter.report(failedMessage.getRight(),
new HttpException(String.format("error response= %s", failedMessage), responseCode));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

failedMessage is already provided to errorReported. In place of failedMessage inlet failure message should be added.

Suggested change
new HttpException(String.format("error response= %s", failedMessage), responseCode));
new HttpException(String.format("error response= %s", <message>), responseCode));


Assertions.assertEquals(1, consumerRecords.count());

ConsumerRecord<byte[], byte[]> consumerRecord = consumerRecords.iterator().next();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please add following properties to connector config and test if headers have all error information -

"errors.deadletterqueue.context.headers.enable": "true",
  "errors.log.enable": "true"

@vivetiwa vivetiwa changed the title PLAT-188185:Send all the failed message to the error reporter topic a… ISSUE-70 Send all the failed message to the error reporter topic a… May 28, 2024
@maniskum maniskum requested a review from vivetiwa May 28, 2024 08:01
| "errors.tolerance": "all","errors.log.enable": "true or false","errors.deadletterqueue.topic.name": "topic-name"|Connector will continue on error and error occurrence will be logged as per the option and failed message will be send to dead letter topic |
| "errors.tolerance": "all","errors.log.enable": "true or false","errors.deadletterqueue.topic.name": "topic-name","errors.deadletterqueue.context.headers.enable": "true" | Connector will continue on error and error occurrence will be logged as per the option and failed message will be send to dead letter topic and failure reason will be logged in message header. |
Please follow documentation for more information : `https://www.confluent.io/blog/kafka-connect-deep-dive-error-handling-dead-letter-queues`

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's add notes in the end that in case of Authentication error such as 401 and 403 connector will stop irrespective of what error tolerance value is.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DOne

…nd throw exception

and Updated the documentation
@vivetiwa vivetiwa merged commit d5257f0 into adobe:master May 31, 2024
4 checks passed
@vivetiwa vivetiwa changed the title ISSUE-70 Send all the failed message to the error reporter topic a… ISSUE-70 Send all the failed message to the error reporter topic May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants