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

feature: implement support for event upcasters, fix #193 #195

Merged
merged 8 commits into from Nov 3, 2021

Conversation

zambrovski
Copy link
Contributor

No description provided.

@CLAassistant
Copy link

CLAassistant commented Oct 12, 2021

CLA assistant check
All committers have signed the CLA.

@zambrovski
Copy link
Contributor Author

The build seem to break because some issues with the build pipeline, see #194

Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

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

Mainly requesting changes as this code should also upcast regular event messages. There's also a discussion to be had on many-to-one and many-to-many upcaster support (or warnings).

@zambrovski zambrovski requested a review from smcvb October 15, 2021 18:29
Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

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

Follow-up remarks. Looking good so far though.

@zambrovski zambrovski requested a review from smcvb October 19, 2021 09:12
@zambrovski
Copy link
Contributor Author

@smcvb I addressed your issues and believe that now the implementation is meeting the requirements. I had to tinker a little with aggregateSeq, since it is passed as long to GenericDomainEventEntry (and not as Long allowing it to be null). I believe that passing the 0L is not wrong and went for this approach. I also changed some methods to be static, if they are not operating on instance variables.

I added some documentation on private methods to reflect the state of this discussion and make it easier to understand for the further development.

Copy link
Contributor

@lfgcampos lfgcampos left a comment

Choose a reason for hiding this comment

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

Couple of nits, mainly typos I would say but LGTM!

zambrovski and others added 4 commits October 21, 2021 12:41
…ndling/DefaultKafkaMessageConverter.java

Co-authored-by: Lucas Campos <lfgcampos@gmail.com>
…ndling/DefaultKafkaMessageConverter.java

Co-authored-by: Lucas Campos <lfgcampos@gmail.com>
…ndling/HeaderUtils.java

Co-authored-by: Lucas Campos <lfgcampos@gmail.com>
Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

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

Just one nit left, other than that, looking good @zambrovski!

Copy link
Member

@smcvb smcvb left a comment

Choose a reason for hiding this comment

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

My concerns have been addressed, hence approving.

@smcvb smcvb removed the request for review from abuijze October 28, 2021 12:30
@smcvb
Copy link
Member

smcvb commented Oct 29, 2021

Interesting to see your changes consistently seem to trigger the normally periodically java.lang.OutOfMemoryError: Java heap space...
I'll give the workflow a couple more tries, but if it persists, I am going to ignore it, merge it and test locally.

As I don't have a hunch where to look right away, I am taking this route in favor of a thorough fix.
If you do have an idea what might be the culprit, Simon, feel free to give your insights.

@zambrovski
Copy link
Contributor Author

zambrovski commented Oct 29, 2021

@smcvb I'm looking on it.

In general, I think it is a good idea to separate unit tests from integration tests running with Kafka ... Usually, we separate them into two phases test/integration-test (surefire/failsafe) and run using two independent Maven runs, using Maven profiles.

Such errors as here:

2021-10-29 12:40:54,247 [main] INFO  KafkaAdminUtils                [] - Completed topic deletion: testSeekUsing_ExistingToken_ConsumerStartsAtSpecificPosition_AndCanContinueReadingNewRecords
Error:  Tests run: 3, Failures: 2, Errors: 0, Skipped: 0, Time elapsed: 55.137 s <<< FAILURE! - in org.axonframework.extensions.kafka.eventhandling.consumer.streamable.TrackingTokenConsumerRebalanceListenerIntegrationTest
Error:  testSeekUsingExistingTokenConsumerStartsAtSpecificPosition  Time elapsed: 6.317 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: Consumed 0 records before timeout instead of the expected 26 records
	at org.axonframework.extensions.kafka.eventhandling.consumer.streamable.TrackingTokenConsumerRebalanceListenerIntegrationTest.testSeekUsingExistingTokenConsumerStartsAtSpecificPosition(TrackingTokenConsumerRebalanceListenerIntegrationTest.java:166)

Error:  testSeekUsingExistingTokenConsumerStartsAtSpecificPositionAndCanContinueReadingNewRecords  Time elapsed: 6.284 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: Consumed 0 records before timeout instead of the expected 26 records
	at org.axonframework.extensions.kafka.eventhandling.consumer.streamable.TrackingTokenConsumerRebalanceListenerIntegrationTest.testSeekUsingExistingTokenConsumerStartsAtSpecificPositionAndCanContinueReadingNewRecords(TrackingTokenConsumerRebalanceListenerIntegrationTest.java:205)

are probably timing / resource related issues inside the I-Test and has more to do with a problem in test setup than in implementation. It would be easier to track the problems down if those tests could be separated from the usual assertions inside JUnit tests...

@smcvb
Copy link
Member

smcvb commented Oct 29, 2021

Thanks for your two cents @zambrovski; was leaning toward something similar for this project.
I might have time somewhere next week but can't make any promises.

@zambrovski
Copy link
Contributor Author

I just created a new issue for that #199 ... Might find some time to make an initial PR for this...

@smcvb
Copy link
Member

smcvb commented Oct 29, 2021

That would be amazing @zambrovski! Much appreciated.

@lfgcampos
Copy link
Contributor

lfgcampos commented Nov 3, 2021

I am going to trust the build is correct and merge it although our workflow is not happy about it.
Thank you very much for the PR @zambrovski!

@lfgcampos lfgcampos merged commit 300e2d3 into AxonFramework:master Nov 3, 2021
@zambrovski zambrovski deleted the feature/event_upcasters branch November 3, 2021 11:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants