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

HWKAPM-484 Refactor the MDBs to have a single processor mechanism for… #454

Merged
merged 2 commits into from Jun 21, 2016

Conversation

objectiser
Copy link
Contributor

… handling individual and bulk processing, with the same retry mechanism

Review notes:

  • Consolidation of the processing of individual and bulk messages into the main processor mechanism, rather than managed separately by two derived MDB implementations.
  • Renamed processor methods to better reflect their purpose

… handling individual and bulk processing, with the same retry mechanism
retries = items;
}
} else {
for (int i = 0; i < items.size(); i++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Wouldn't it be better to use a stream here, instead of a loop? Due to the operations done inside the loop, I think this is a perfect candidate for streams :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Although I haven't tried it to be sure, my concern would be performance, e.g. https://jaxenter.com/java-performance-tutorial-how-fast-are-the-java-8-streams-118830.html

I can create a separate jira to investigate this?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure! When I first saw the code, I had the impression that streams would be better, but I see that you are not doing actions on filtered records, but deciding the action based on the record type. So, you might be right that loops will perform better here.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@jpkrohling
Copy link
Contributor

LGTM

@objectiser objectiser merged commit 2516ecb into hawkular:master Jun 21, 2016
@objectiser
Copy link
Contributor Author

@jpkrohling Thanks!

@objectiser objectiser deleted the HWKAPM-484 branch November 14, 2016 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants