How to allow and parse FIX message with QuickFIX if Field 55 appears multiple times in FIX incoming message? - quickfix

This particular broker does not provide a DataDictionary so I have to create my own based on their documentation.
This is how they send a particular message:
FIX.4.4|9=709|35=y|34=53|49=DUMMYBROKER|56=<client_ID>|52=20210211-
12:12:37.358847|55=AUD/CAD|55=AUD/CHF|55=AUD/JPY|55=AUD/NZD|55=AUD/USD|55=
CAD/CHF|55=CAD/JPY|55=CHF/JPY|55=EUR/AUD|55=EUR/CAD|55=EUR/CHF| ...
etc
How can I allow QuickFix a field to appear multiple times?
Once I recieve the message what is the best way to read it? I am using QuickFIX/n.
This would probably provide me the last symbol only:
var symbolstring = message.GetString(Tags.Symbol);
This is how the SecurityList is defined in the DataDictionary:
<message name="SecurityList" msgtype="y" msgcat="app">
<group name="NoMDEntries" required="Y">
<field name="Symbol" required="N"/>
</group>
</message>
I have tried changing "Y"/"N" in all variations, but it still cannot absorb the message properly.

This message is invalid FIX, and is simply not parseable by QuickFIX/n (or any QF engine).
A repeating group must start with a counter field which tells the receiver how many instances of that group will follow. Their message doesn't have that counter field.

Related

How to use FIXT11 function in quickFix/n package

I have a question of using FIXT1.1 xml.
Indeed, I have successfully established the connection by using the transport dictionary (FIXT11.xml) and app dictionary (FIX50SP2.xml) ; However, I would like to do the following action manually:
Resend Request
SequenceReset
I found these two messages available in the transport dictionary:
<fix type='FIXT' major='1' minor='1' servicepack='0'>
...
<message msgcat='admin' msgtype='2' name='ResendRequest'>
<field name='BeginSeqNo' required='Y'/>
<field name='EndSeqNo' required='Y'/>
</message>
<message msgcat='admin' msgtype='4' name='SequenceReset'>
<field name='GapFillFlag' required='N'/>
<field name='NewSeqNo' required='Y'/>
</message>
but I cannot create this message class manually as I used to in FIX44. I've looked through the names spaces in QuickFix.dll but there is no such object know as QuickFix.FIXT11 in the quickfix/n package
Create message directly using QuickFix/n FIX44 object
QuickFix.FIXT11 missing in quickfix/n package
Do you have any recommendation what should I do?

Unable to receive message from WEB-SPHERE MQ queue by using Citrus Frame work xml test cases

I am trying to receive messages from web-sphere mq queue by using citrus framework by defining actions in XML-test-cases. as shown below.
<receive endpoint="jms:Queue_Name?timeout=1000">
<selector>
<element name="correlationId" value="303132333435363738393130313131323133313431353136"
</selecotr>
<message>
</message>
</receive>
I tried mentioning correlation id with hexadecimal value and ASCII value but I am unable to get the message I am getting ACTION TIME OUT EXCEPTION. I cross checked correlation id that existed in WEB-SPHERE MQ with mentioned correlation id in xml. but without selector tag I am able to get the message that was inserted first in the queue based on time.
You have to give correlation ID value like this it will work for you
<receive endpoint="jms:Queue_Name?timeout=1000">
<selector>
<element name="correlationId" value="ID:${varible consisting og hexa value}"
</selecotr>
<message>
</message>
</receive>

quickfixn executionreport 35=8 in message log but didn't hit fromapp or crack

So we send a FIX deal message without a side, and the bank rejects with a 35=8 execution report with 150=8 reject, and text FIX Tag 54 (Side) has invalid value (0). Reason (should be either 1 or 2) and then a 35=3 reject message with Value is incorrect (out of range) for this tag. The 35=3 message is cracked but the 35=8 message never gets to fromapp.
Am I missing a setting?
35=3 indicates a transport-level (aka admin-level) reject. The message was rejected at a lower parsing layer, which means that it's so malformed that it wasn't even passed up to your application.
Usually this kind of reject means that the message was messed up in a way such that the engine can't even parse it correctly, or that the header fields can't resolve to a known session. I'm a little surprised that your particular situation triggered a 35=3 instead of a 35=j.
I suppose you could check the FIX spec to see what it mandates when an enum-type tag has an unknown value. Maybe the engine is following spec in this case?
I guess the reason why the 35=8 message with the incorrect 54=0 tag doesn't get to FromApp or FromAdmin is because of a data dictionary constraint, but this gave me a chance to implement the public void FromEarlyIntercept(Message msg, SessionID s) interface, and that has solved the problem that a bad 35=8 report is now reported back to the user... but introduced a new problem that a good report is now reported twice.
So I added <value enum="0" description="ERROR"/> to the enumeration for <field number="54" name="Side" type="CHAR"> and now the 35=8 message is not rejected by a 35=3 message.

quickFix - sending XML message for Fix 4.4 failing validation

while sending a FIX 4.4 xml message msgType as n - the message fails validation (yes, we perform validation while sending fix message out) - with error.
quickfix.FieldException: Invalid MsgType, field=-1
at quickfix.DataDictionary.checkMsgType(DataDictionary.java:699)
at quickfix.DataDictionary.validate(DataDictionary.java:647)
at quickfix.DataDictionary.validate(DataDictionary.java:624)
Searched everywhere but not able to get much help.
that was the issue. Making following ammendments to the dictionary solved the issue.
<message name="XML_non_FIX" msgtype="n" msgcat="app">
<field name="XmlDataLen" required="N"/>
<field name="XmlData" required="N"/>
</message>
It looks like the standard data dictionaries for FIX 4.4 in QuickFIX don't contain message type n (msgtype="n"), you will have to add the message type yourself. Incidentally I have never seen XMLnonFIX messages before so had to look it up first!

How to store pubsub payloads in DB

I am using XMPP pubsub.Everything is working fine.User can create node and interested user can subscribe to that node.But I want to store the publish action into DB.Because in my application many things are handled by pubsub like chat,feeds etc so on page refresh I want to persist chat.So I m looking for any openfire plugin which saves it into DB behind the scenes. Like openfire saves chat in case of MUC (Multiple User Chat).I dont want to manually send ajax request. So is there any way to log the publish items.
Update:
There was a problem in my form configuration in which persist items was set to false by default.So I configured the node as you suggested.But again I am facing some problem on page refresh.I will explain you with an example. In my application user A logs in and create a node and on successful creation it sends request to user B, now user B subscribe to the node created by user A.Now if any user does a page refresh I send an IQ stanza of type get to get all the missed events like the one you mentioned above.But I am getting error 400 subid-required.
<body rid='430432056' xmlns='http://jabber.org/protocol/httpbind' sid='dca8aafc'><iq to='pubsub.abc' type='get' xmlns='jabber:client' id='3408:sendIQ'><pubsub xmlns='http://jabber.org/protocol/pubsub'><items node='3821poU5zq7nhn1'/></pubsub></iq></body>
In response I am getting:
<body xmlns='http://jabber.org/protocol/httpbind'><iq type="error" id="3408:sendIQ" from="pubsub.abc" to="test#abc/dca8aafc"><pubsub xmlns="http://jabber.org/protocol/pubsub"><items node="3821poU5zq7nhn1"/></pubsub><error code="400" type="modify"><bad-request xmlns="urn:ietf:params:xml:ns:xmpp-stanzas"/><subid-required xmlns="http://jabber.org/protocol/pubsub#errors"/></error></iq></body>
So can help me where I am getting wrong.Also I read the link http://xmpp.org/extensions/xep-0060.html#owner-configure point : 6.5.9.1 which says
If the requesting entity has multiple subscriptions to the node but does not specify a subscription ID, the service MUST return a error to the subscriber.So does it mean that I am subscribing to the same node again?
I checked if thats the case but I am subscribing only once.So just figuring out where things are getting wrong.
Per XMPP's XEP-0060, it is possible for Owner of the PubSub node to make items on the node expire in a very distant future.
When creating a node, you may want to set the following attributes to make items on the node never expire.
<field var='pubsub#persist_items' type='boolean' label='Persist items to storage'>
<value>1</value>
</field>
<field var='pubsub#max_items' type='text-single' label='Max # of items to persist'>
<value>999999</value>
</field>
<field var='pubsub#item_expire' type='text-single' label='Time after which to automatically purge items'>
<value>999999999999</value>
</field>
Source: http://xmpp.org/extensions/xep-0060.html#owner-configure
Then when you want to retrieve all the items, you can probably do this to retrieve the data:
<iq type='get'
from='francisco#denmark.lit/barracks'
to='pubsub.shakespeare.lit'
id='items1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='princely_musings'/>
</pubsub>
</iq>
Source: http://xmpp.org/extensions/xep-0060.html#subscriber-retrieve-requestall
Would this solve your problem?