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

Fix consumer #62

Merged
merged 2 commits into from
Feb 7, 2019
Merged

Fix consumer #62

merged 2 commits into from
Feb 7, 2019

Conversation

viartemev
Copy link
Owner

closes: #39
closes: #38

@todo
Copy link

todo bot commented Feb 7, 2019

@viartemev viartemev force-pushed the fix-consumer branch 2 times, most recently from 8b57d9b to d978cf2 Compare February 7, 2019 13:00
} catch (e: Exception) {
logger.error { "Can't send nack for deliveryTag: $deliveryTag" }
} finally {
throw RuntimeException(errorMessage)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we need some specific exception here for user to be able to implement some recover plan.

try {
AMQPChannel.basicAck(deliveryTag, false)
} catch (e: Exception) {
val errorMessage = "Can't ack a message with deliveryTag: $deliveryTag"
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is it truth that if we've got exception then it's ack? What about ACK + IO exception?

Copy link
Owner Author

Choose a reason for hiding this comment

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

We use try-catch only for basicAck. A user is responsible for handling exceptions which can be thrown from the handler.

} catch (e: Exception) {
val errorMessage = "Can't ack a message with deliveryTag: $deliveryTag"
logger.error { errorMessage }
throw RuntimeException(errorMessage)
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we should throw some concrete exception here for user to be able to recover from error somehow.

@viartemev viartemev force-pushed the fix-consumer branch 2 times, most recently from ba263c3 to 7aa85d4 Compare February 7, 2019 13:15
@todo
Copy link

todo bot commented Feb 7, 2019

@viartemev viartemev merged commit e000609 into master Feb 7, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-consumer branch February 7, 2019 13:42
This was referenced Feb 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
2 participants