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

Store message-context in ErrorStorage #6339

Merged
merged 7 commits into from
Feb 26, 2024

Conversation

tnleeuw
Copy link
Contributor

@tnleeuw tnleeuw commented Feb 22, 2024

No description provided.

@tnleeuw tnleeuw added the 7.9 label Feb 22, 2024
@tnleeuw tnleeuw self-assigned this Feb 22, 2024
@tnleeuw tnleeuw linked an issue Feb 22, 2024 that may be closed by this pull request
@tnleeuw tnleeuw requested a review from nielsm5 February 23, 2024 08:36
Copy link
Sponsor Member

@nielsm5 nielsm5 left a comment

Choose a reason for hiding this comment

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

Ja gaat de goede kant op!

Comment on lines +67 to +69
public MessageContext(MessageContext base) {
this(base.data);
}
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Is dit handig? Wanneer wordt dit gebruikt? Misschien dat het handiger is om een copy methode te hebben. Anders hebben we straks mogelijk 2 pointers naar de zelfde context.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

De data wordt wel gekopieerd in die andere constructor, dus we hebben niet 2 pointers naar dezelfde. Ik zal even opzoeken waar het gebruikt wordt, om te kijken of het nodig / wenselijk is.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Deze constructor wordt 2x gebruikt, in Message.copyContext() en in de constructor van PathMessage.
De constructor die een map als parameter neemt wordt ook 2x gebruikt: in FileSystemUtils.getContext() en in de constructor van UrlMessage.

Ik zou deze constructors kunnen weghalen en vervangen door .withAllFrom(...)?

}

private PartMessage(MessageContext context, Part part) throws MessagingException {
public PartMessage(MessageContext context, Part part) throws MessagingException {
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

Ik vind het misschien mooier om de context (als optionele) 2e param mee te geven.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Op zich heb je gelijk. Dit was ooit nodig denk ik om overlappende constructors uit elkaar te halen, maar dat is nu geen excuus meer.

public void putAll(Map<String, ?> base) {
if (base!=null) {
base.forEach((key, value) -> {
if (value instanceof Serializable) data.put(key, (Serializable) value);
Copy link
Sponsor Member

Choose a reason for hiding this comment

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

En anders? Ten minste een log melding denk ik, of als transient toevoegen oid.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Goed punt. Ik denk dat we in de context wel een map van Map<String, Object> moeten houden maar dat we in writeObject() dan alles eruit moeten filteren wat niet Serializable is, zodat er dan in ieder geval geen onverwachtte fouten optreden bij het schrijven naar de error-store, en op dat moment een warning loggen voor al die keys.

@nielsm5
Copy link
Sponsor Member

nielsm5 commented Feb 23, 2024

Ik vind hem nu al goed!

@jkosternl jkosternl self-requested a review February 23, 2024 18:35
@@ -1,5 +1,5 @@
/*
Copyright 2020-2022 WeAreFrank!
Copyright 2020-2024 WeAreFrank!
Copy link
Contributor

Choose a reason for hiding this comment

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

Always a good time to update copyrights 😜

@nielsm5 nielsm5 changed the title Store message-context in Error Store Store message-context in ErrorStorage Feb 26, 2024
@nielsm5 nielsm5 merged commit d671373 into 7.9-release Feb 26, 2024
11 checks passed
@nielsm5 nielsm5 deleted the issue/7.9/5992_StoreMessageContextInErrorStore branch February 26, 2024 08:32
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.

Store messageContext in error store
3 participants