Asanka
So we have two options
[1] Fix the bug in QFJ side and use data dictionary to identify the repeating groups. Accessing the DD for each FIX message will effect our message processing time because I noticed that API calls for the data dictionary is very slow.
Any possibility to use the DD once for each type of message and cache results? We could ship a binary patch against QFJ until such time they accept and include any fix you make into its code base
[2] Change the way Synapse do the FIX transformation to XML infoset . - Current implementation access the qfj.Message and iterate through the data structures provided by qfj and build the AXIOM tree. My proposal is to use a simple way and it will cut down the 100+ code to 14 lines of code.

This is the code snippet
            String fixToXML = message.toXML().replaceAll("\n","");
InputStream is = new ByteArrayInputStream(fixToXML.getBytes()); XMLStreamReader parser = XMLInputFactory.newInstance().createXMLStreamReader(is);
            StAXOMBuilder builder = new StAXOMBuilder(parser);
            OMElement documentElement =  builder.getDocumentElement();
            SOAPFactory soapFactory = new SOAP11Factory();
documentElement.addAttribute(soapFactory.createOMAttribute(FIXConstants.FIX_MESSAGE_INCOMING_SESSION, null, sessionID));
            System.out.println (documentElement.toString());
            SOAPEnvelope envelope = soapFactory.getDefaultEnvelope();
            envelope.getBody().addChild(documentElement);
            msgCtx.setEnvelope(envelope);

This will basically create the AXIOM tree using the qfj.Message.toXML().
Few changes will apply for the current implementation
1. Will not have CDATA section in the xml infoset
2. Attribute "id" in the element "Field" will rename as "tag"
3. Will not check binary content (FIX is not made to send binary data, and from my past experience with the FIX users none of them sent binary with FIX , FAST is there for binary transports for financial messaging)

I did apply this change to my local workspace and it is working perfectly with the FIX scenarios we have and it supports ***repeating groups*** as well.
WDYT ?
How large can a FIX message get? Can it contain binary? attachments etc? This will let us determine if reading the message into a String is appropriate. For example a JMS Text message can be read into a String, as always its also loaded into memory.

asankha

--
Asankha C. Perera

WSO2 - http://wso2.org
http://esbmagic.blogspot.com

Reply via email to