[QFJ-512] How do I change the order of the header tags? Created: 04/Mar/10 Updated: 15/Dec/14 Resolved: 20/Mar/11 |
|
Status: | Closed |
Project: | QuickFIX/J |
Component/s: | None |
Affects Version/s: | None |
Fix Version/s: | None |
Type: | Other | Priority: | Default |
Reporter: | Willis Todd | Assignee: | Unassigned |
Resolution: | Fixed | Votes: | 0 |
Labels: | None | ||
Environment: |
Using FIX 4.4 (QuickFIX/J) in Eclipse. |
Issue Links: |
|
Description |
I currently have a working application for one broker using FIX 4.4 and want to use it to connect to another broker using 4.4 with different information in my config file to login, but the problem I am having is that the second broker wants the first seven tags in a specific order, slightly different than my app that is currently sending them and I don't know how to change it. I'm not a professional programmer, so maybe that's why I am feeling so lost, but here is where I am at: Their spec asks for the first 7 fields in the exact order, tag 8, 9, 35, 49, 56, 34, 52. But I have 8, 9, 35, 34, 49, 50. 8=FIX.4.4 Seeing that tag 50 is blank, maybe I should delete that one while I'm at it? If anyone has done this, or can explain how, I am totally lost! At this point, they won't even let me login to the second one without the order of these tags being changed. |
Comments |
Comment by Laurent Danesi [ 04/Mar/10 ] |
Hi, You need to modify your FIX44.xml file to set the order you want for each message (8,9,35,49,56,34 et 52 in your case). <param name="generator.orderedFields" value="true"/> This will generate FIX Messages with ordered fields and should fix your issue. Laurent |
Comment by Willis Todd [ 04/Mar/10 ] |
Hey Laurent, <fix major="4" minor="4"> The required tags are the ones I need, and they are already in the order I need if we ignore the tags not required. So I just want to make sure this is the first part you were talking about. The part about regenerating the Fix messages with Eclipse Ant launcher is the part I have never done and I can't find. And do I just put the line of code you mentioned inside the xml file at the top? Or is that put somewhere else when I find the Ant Launcher? Again, I apologize for being such a newbie on this. |
Comment by Laurent Danesi [ 04/Mar/10 ] |
Hi, Sorry, I will try to be more precise this time . <property name="generator.orderedFields" value="false" /> change it to <property name="generator.orderedFields" value="true" /> Save the file. Put your FIX44.xml file in quickfixj/core/src/main/resources. Finally regenerate the Java code of the FIX messages by opening a CommandLine in quickfixj/core and type: ant generate.code. Feel free to contact me if you need more informations. Laurent |
Comment by Willis Todd [ 04/Mar/10 ] |
Thank you again Laurent! |
Comment by Laurent Danesi [ 05/Mar/10 ] |
Hi, Yes, you are correct you need to download another package http://sourceforge.net/projects/quickfixj/files/QuickFIX_J/1.4.0/quickfixj-1.4.0-src.zip/download containing the source files thsi time instead of jar files. Laurent |
Comment by Willis Todd [ 05/Mar/10 ] |
I don't know what I wasn't able to find that, but thank you very much for the link! I have done every step now except for the last one. Here's what I see in the command line when I try to do the last step: C:\quickfixj>cd \quickfixj\core C:\quickfixj\core>ant generate.code. C:\quickfixj\core>ant generate.code C:\quickfixj\core> Is this because I need to install something more for me to use ant? In your first message you mentioned something about Eclipse Ant launcher, so I'm wondering if I should try that maybe? Or maybe if I did something wrong i the command line, you can tell me that. |
Comment by Willis Todd [ 05/Mar/10 ] |
I was trying to use Eclipse to do this and made a new project, then in the java settings, under the source tab, I clicked on Link Additional Source, and selected the quickfixj folder. Then I used the package explorer to right click the build.xml in the core folder and selected Run As ---> 2 Ant Build... and the Edit Configuration window comes up with jar [default] "build jar files" being the only thing selected, and I click run. But I don't see where the jar files being created, or where they are being sent to if they are created. So I don't know if that was what I was supposed to do or not. Let me what you think. |
Comment by Willis Todd [ 08/Mar/10 ] |
So I thought maybe ant wasn't installed, so I have been working on installing it and used winant from this site: |
Comment by Laurent Danesi [ 09/Mar/10 ] |
Hi, Great job, now you have the new source files respecting the ordered fields you provided in FIX44.xml. You must now execute the ant task release.versioned that will generate all the jars you need. This task is in the build.xml at the root of your quickfixj project. Laurent |
Comment by Willis Todd [ 09/Mar/10 ] |
Thanks again Laurent!! I did as you said above, and it did generate .jar files, though I'm not sure if it did everything it was supposed to, as I saw this at the end: test.unit.junit: BUILD FAILED Total time: 4 minutes 8 seconds So I tried using the jar files anyway in place of the jar files I was using, but I get errors initiating sessionSettings and it never sends the fix message. I finally got it to send the fix message after including these 3 previously used jar files: mina-core-1.1.2.jar, slf4j-api-1.5.3.jar, slf4j-jdk14-1.5.3.jar, and just excluding this 1 previously used jar: quickfixj-all-1.4.0.jar. However, the fix message tags that get sent are still in the order they were before, rather than in the new order specified in the beginning of the FIX44.xml file. Is this something to do with the 3 other jar files I am using do you think? I was hoping I wouldn't need to include any of the old jar files, but then like I said, it doesn't send any fix message at all for me. What do you suggest I do? Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory Thanks again for all your help Laurent! |
Comment by Willis Todd [ 17/Mar/10 ] |
Hey Laurent, |
Comment by Willis Todd [ 30/Mar/10 ] |
Thanks again for your help Laurent! To anyone else having this problem, I had my jars rebuilt with a header.cfg file that specifies what order to put the tags in. If anyone else is in the same boat as I was and needs it, just let me know and I can send it to you! |
Comment by Willis Todd [ 21/Jun/11 ] |
Hey Aadil, I can't remember for sure if I already helped you with this or not, but in case I didn't, please feel free to e-mail me and I can share the code and rebuilt jars that worked for me. willis11of12 at rome dot com |
Comment by Jörg Thönnes [ 21/Jun/11 ] |
As I created QFJ-416, I was sure that the header order cannot specified. Did this change meanwhile? Otherwise, I could pick up some tweaks out of my code... |
Comment by Willis Todd [ 24/Jun/11 ] |
Jörg, I can send you the jar files that were created for me that have a header order config file with them, though I recently realized that with using the newest version of quickfix/j, I don't have any problem connecting to the same platform without using it. So now I am wondering if they really did much. It seems that using it allows me to change the order of some tags, but not all of them... weird. Anyway, just send me an e-mail if you want me to send you what I have and you can check it out. |
Comment by Andreea Ion [ 12/Apr/12 ] |
Hy, I tried to do exactly like you but I didn't manage to succed. I am building the project in eclipse and I have the same error as you Can you tell me how can I do thsi work, in order to change the hearder tads . |
Comment by Øyvind Hansen [ 11/Dec/14 ] |
Hello, we are having the same issue with FIX 4.4. We have set up a specific order of fields in the header in the datadictionary. However, in the fix messages the header fields are sorted by fix tag number, conflicting the order in the datadictionary. Because this post is over four years old, we were wondering if this solution is still the one to go for. Our broker also wants the fields in the header in a specific order. Thank you, |
Comment by Christoph John [ 15/Dec/14 ] |
AFAIK there currently is no other way than to rebuild QFJ as Laurent suggested in his first comment. |