Skip to content

fix: implement Exception Handling in Kafka Publisher#430

Open
sancheet230 wants to merge 18 commits intoasyncapi:masterfrom
sancheet230:issues
Open

fix: implement Exception Handling in Kafka Publisher#430
sancheet230 wants to merge 18 commits intoasyncapi:masterfrom
sancheet230:issues

Conversation

@sancheet230
Copy link
Copy Markdown

@sancheet230 sancheet230 commented Mar 6, 2025

For issue #431

Description
This pull request enhances the PublisherServiceImpl class by incorporating robust exception handling mechanisms during Kafka message publishing. These improvements aim to ensure reliable message delivery and facilitate effective error management within our Kafka producer implementation.

Prior to this update, the PublisherServiceImpl class lacked comprehensive exception handling during message publication. This omission posed risks of unhandled exceptions leading to application instability and potential message loss. Implementing proper exception handling is crucial for maintaining the reliability and resilience of the Kafka producer.

By integrating these exception handling strategies, the Kafka producer's resilience and reliability are significantly enhanced. These modifications ensure that message delivery failures are appropriately managed, thereby reducing the risk of data loss and improving overall system stability.

…eption handling mechanisms during Kafka message publishing.
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@sancheet230 sancheet230 changed the title Implement Exception Handling in Kafka Publisher fix: Implement Exception Handling in Kafka Publisher Mar 6, 2025
@sancheet230 sancheet230 changed the title fix: Implement Exception Handling in Kafka Publisher fix: implement Exception Handling in Kafka Publisher Mar 6, 2025
@sancheet230
Copy link
Copy Markdown
Author

sancheet230 commented Mar 6, 2025

@Tenischev @derberg @asyncapi-bot-eve Can you please review these changes

@sancheet230
Copy link
Copy Markdown
Author

sancheet230 commented Mar 20, 2025

@asyncapi-bot @asyncapi-bot-eve Can you check this PR out

@Tenischev
Copy link
Copy Markdown
Member

Hi @sancheet230
I agree that implementation example could be improved, but please keep in mind that this repository provides the template that should generate code based on provided AsynAPI documentation.
Most of all my review comments related to the changes of template names and parameters to the hardcoded.
Please run tests and adjust for your changes.

Comment thread partials/KafkaPublisherImpl.java Outdated
Comment thread partials/KafkaPublisherImpl.java
Comment thread partials/KafkaPublisherImpl.java
Comment thread partials/KafkaPublisherImpl.java Outdated
@sancheet230
Copy link
Copy Markdown
Author

@Tenischev Replaced deprecated ListenableFutureCallback with CompletableFuture, improved async handling, added proper exception handling for sync sends, and ensured template-driven dynamic method generation

@sancheet230 sancheet230 requested a review from Tenischev March 20, 2025 13:26
@sancheet230
Copy link
Copy Markdown
Author

sancheet230 commented Mar 20, 2025

@Tenischev I have done the changes PTAL

Copy link
Copy Markdown
Member

@Tenischev Tenischev left a comment

Choose a reason for hiding this comment

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

When you finish with update of the PublisherService, please run and update tests

Comment thread partials/KafkaPublisherImpl.java
Comment thread partials/KafkaPublisherImpl.java
Comment thread partials/KafkaPublisherImpl.java
@sancheet230
Copy link
Copy Markdown
Author

sancheet230 commented Jun 22, 2025

@Tenischev done all the asked changes and also updated tests snapshots and all tests are passing now
Screenshot from 2025-06-22 10-11-44

@sancheet230 sancheet230 requested a review from Tenischev June 22, 2025 04:43
@sancheet230
Copy link
Copy Markdown
Author

@Tenischev everything passing now you can review this

@sancheet230
Copy link
Copy Markdown
Author

@Tenischev PTAL

@github-actions
Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 120 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. AsyncAPI Initiative is a Linux Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions Bot added the stale label Apr 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants