-
Notifications
You must be signed in to change notification settings - Fork 656
Fixed FIX message XML conversion #322
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
Fixed FIX message XML conversion #322
Conversation
|
Hi @the-thing , thanks for the PR.
But actually it is only a whitespace change, isn't it? I'm not the XML guy, but this only matters when textually comparing the XML output and parsers shouldn't care, right? |
|
Yes - only whitespace/formatting. We could only change the test and the XML document would still be valid, but we would get different method behaviour between Java versions. |
|
Closing/re-opening to trigger rebuild with CI pipeline. Edit: does not work, new CI pipeline is not used. :-/ |
9d07c74 to
4702a84
Compare
|
I have seen. I rebased from master and forced pushed, but it did not help. |
|
Maybe this is the reason? https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#pull-request-events-for-forked-repositories
|
|
Yeah, but repo is not private. I think you need to add something like
|
|
Was just about to add that, when I found the statement about the private repos. But you are right, will try. |
|
Works now. |
|
BTW. Are you planning to phase out Travis CI completely at some point? Just asking. |
|
Actually I just wanted to try out the github actions. Personally I found them easier to configure but maybe there are some features of Travis CI that are better? Not played around with them that much up to now. What do you think? |
|
No opinion, but it looks like compiling and running on different Java versions is easier in GitHub. In Travis you have to use jdk_switcher etc. If the actions work, I would probably get rid of Travis at some point. Edit: I think it would be useful to add "opened, synchronize" to pull request triggers. |
|
Here https://docs.github.com/en/free-pro-team@latest/actions/reference/events-that-trigger-workflows#pull_request it is stated that
But did not seem to work though. Maybe because your PR was newer than the latest CI workflow changes. |
|
Not sure. Other thing. It seems like this particular pull request fix does work, although on my branch there are two additional race condition problems detected - https://github.com/the-thing/quickfixj/actions/runs/317548182.
|
Hmm, interestingly these only occur for JDK15. But might be coincidence. |
|
|
|
@the-thing , w.r.t. |
|
#326 should help with Maven connectivity. I run from a branch based on this PR and it was only failing on |
|
@the-thing w.r.t. backwards compatibility: do you think we could introduce a |
4702a84 to
274ab5c
Compare
|
Added the appropriate flag to method signatures. By default (old method signatures) indent is disabled. |
|
Only Do you think we should make a change to be fully compatible with previous versions as you pointed out above? (we will be having inconsistent behaviour across Java versions). if (indent) {
serializer.setOutputProperty(OutputKeys.INDENT, "yes");
serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
} else {
serializer.setOutputProperty(OutputKeys.INDENT, "no");
}
I'm actually curious if anyone is using XML serialisation and actually how many companies have deployed QuickFIXJ on Java 11. Adoption rate of Java versions > 8 is quite low and probably even lower in finance, because of procedures and regulations. |
|
The test My gut feeling is to be backward compatible instead of consistent across Java versions mainly due to the reason that this is a more or less pretty-print method and that only white-space is added. |
|
Ok. But then I'm not sure what the behaviour should be at this stage. Just looks awkward.
serializer.setOutputProperty(OutputKeys.INDENT, "yes");
serializer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "4");
This gives consistent behaviour across all Java versions (with exception to CDATA element but - https://bugs.openjdk.java.net/browse/JDK-8215543)
serializer.setOutputProperty(OutputKeys.INDENT, "yes"); Old behaviour. Obviously for Java version >= 11 will behave as |
|
OK, what about fixing this in the next major release then instead of 2.2.1? Because until we set up the build jobs for Java11 no-one ever seemed to notice that there was a problem. But actually, my statement about "pretty-print method and that only white-space is added" could also be interpreted as: we should fix it in the minor release because probably no-one will notice the change in the XML output. |
|
Yeah exactly. Nobody noticed until GitHub build actions. How about we add @ignore to this nasty test via another PR and this can be merged later, once the GA work. |
Agreed. :) |
da3a063 to
5c345fb
Compare
- FIX message XML indent can be chosen by flag
5c345fb to
9c08912
Compare
|
@the-thing I don't remember exactly what we wanted to do with this but IMHO it could be integrated into 3.0.0. |
|
There was a test disabled in #329 because of the JDK bug described in https://bugs.openjdk.java.net/browse/JDK-8215543 to help pass new GitHub CI builds across different VM versions. This test was fixed here by explicitely removing whitespace characters. Also Previously the default behaviour was |
fixed small typo
This should fix
quickfix.MessageTest#shouldConvertToXmlWhenDataDictionaryLoadedWithExternalDTDfailing in #319When using
INDENTit is mandatory to specifyindent-amountas well, otherwise the generated XML will not be indented properly.quickfixj/quickfixj-core/src/main/java/quickfix/Message.java
Line 346 in 83c0c98
However, this is not that case in Java 11 anymore. It seems to be using default
indent-amountequal to 4, when not explicitly defined.Changes
indent-amountso the formatting is the same on Java 8/11/15. We are breaking backwards compatibility here as Java 8 will convert FIX messages with indent from now on.