added support to spring amqp batch#1716
Conversation
💚 Build Succeeded
Expand to view the summary
Build stats
Test stats 🧪
💚 Flaky test reportTests succeeded. 🤖 GitHub commentsTo re-run your PR in the CI, just comment with:
|
Codecov Report
@@ Coverage Diff @@
## master #1716 +/- ##
============================================
- Coverage 69.42% 61.30% -8.12%
- Complexity 2789 3621 +832
============================================
Files 291 401 +110
Lines 12413 18249 +5836
Branches 1616 2507 +891
============================================
+ Hits 8618 11188 +2570
- Misses 3214 6278 +3064
- Partials 581 783 +202
Continue to review full report at Codecov.
|
eyalkoren
left a comment
There was a problem hiding this comment.
Nice! 👏
A few minor comments, overall looks really good!
I am pushing a small fix that will allow testing.
| if (message == null) { | ||
| return message; | ||
| } |
There was a problem hiding this comment.
message shouldn't be null.
In such case, next() would throw NoSuchElementException, so you can just remove this check and rely on the original implementation.
| public interface MessageBatchHelper<MSG> { | ||
|
|
||
| List<MSG> wrapMessageBatchList(List<MSG> messageBatchList); | ||
| } |
There was a problem hiding this comment.
There is no need for a generic interface, as long as the helpers are only being referenced by advices.
The advice classes can depend on helpers with specific AMQP dependencies (as opposed to the instrumentation classes)
| } | ||
|
|
||
| static class BaseAdvice { | ||
| protected static final MessageBatchHelper messageBatchHelper; |
There was a problem hiding this comment.
Shouldn't this be on the batch advice instead of the base advice?
There was a problem hiding this comment.
moved to SpringAmqpBatchMessageListenerInstrumentation$MessageListenerContainerWrappingAdvice
| import javax.annotation.Nonnull; | ||
| import javax.annotation.Nullable; | ||
|
|
||
| public interface SpringAmqpTransactionHelper { |
There was a problem hiding this comment.
Why is this interface required? Can't we just use the single impl as is?
There was a problem hiding this comment.
yes, this interface not required. Deleted
| if (messageProperties == null) { | ||
| return message; | ||
| } |
There was a problem hiding this comment.
Why? We should create a transaction anyway - a root transaction if there is no traceparent property, or child transaction if there is. We already do that (create a transaction when there is no property). The same goes for SpringAmqpMessageListenerInstrumentation - we should allow null properties.
Please fix SpringAmqpTransactionHelper#createTransaction() instead to allow for null properties (and treat the same as if there are properties without context property).
…rt-spring-amqp-batch
…rt-spring-amqp-batch
…amqp-batch' into feature-add-support-spring-amqp-batch
1eec8f3 to
0ccf528
Compare
|
Thanks for applying the review comments ❤️ Please see my last commits - I only removed another interface, changed helper names, added to CHANGELOG and added a test for distributed tracing. Please let me know if you disagree with any of this. |
|
run elasticsearch-ci/docs |
|
@kananindzya we removed our |
Head branch was pushed to by a user without write access
fixed |
|
run elasticsearch-ci/docs |
closes #1706
What does this PR do?
Checklist