Incorrect NumInGroup count for repeating group (Field=268) - quickfix

When I recieve a Market Data Snapshot Full Refresh message, my app cannot consume it.
This is how the message looks like:
8=FIX.4.4|9=160|35=W|34=1625|49=DummyBroker|56=DummyID|52=20220201-15:17:17.201806|262=43_MarketDataChange|55=USD/CHF|268=6|269=0|270=0.92282|271=400000|269=1|270=0.92293|271=400000|10=227|
Human readable format (please ignore the Invalid lines):
Error message my app is sending back to the server: Rejected: Incorrect NumInGroup count for repeating group (Field=268)
268=6 seems ok to me, so I am guessing that something is wrong with the DataDictionary.
This is how the message appears in my DataDictionary:
<message name="MarketDataSnapshotFullRefresh" msgtype="W" msgcat="app">
<field name="MDReqID" required="N"/>
<field name="Symbol" required="Y"/>
<group name="NoMDEntries" required="Y">
<field name="MDEntryType" required="Y"/>
<field name="MDEntryPx" required="Y"/>
<field name="MDEntrySize" required="Y"/>
</group>
</message>
Relevant fields:
<field number="268" name="NoMDEntries" type="NUMINGROUP"/>
<field number="269" name="MDEntryType" type="CHAR">
<value enum="0" description="BID" />
<value enum="1" description="OFFER" />
</field>
<field number="270" name="MDEntryPx" type="PRICE"/>
<field number="271" name="MDEntrySize" type="QTY"/>
In my config file ValidateFieldsHaveValues=N, ValidateFieldsOutOfOrder=N.
Anyone knows where the issue is?

As #ChristophJohn mentioned NoMDEntries should be 2 not 6, so the error is on the broker side.
It was already explained here:
what is "NoMDEntries"?
The correct message should look like this:
8=FIX.4.4|9=160|35=W|34=1625|49=DummyBroker|56=DummyID|52=20220201-15:17:17.201806|262=43_MarketDataChange|55=USD/CHF|268=2|269=0|270=0.92282|271=400000|269=1|270=0.92293|271=400000|10=227|

Related

how to add field to product.template in odoo 12

I would like to display a field in Form View of the product module, here is the python file (i use odoo 12.):
class ClassProductInherited:
_inherit = 'product.template'
file = fields.Char(string="Choose File")
Here is xml code (i use odoo 12.):
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[#name='inventory']/group" position="before">
<group col="2" colspan="2">
<field name="file"/>
</group>
</xpath>
</field>
</record>
When I restart the server, problem is that I have the following error:
File "/home/odoo/models.py", line 1112, in _validate_fields
raise ValidationError("%s\n\n%s" % (_("Error while validating constraint"), tools.ustr(e)))
odoo.tools.convert.ParseError: "Error while validating constraint
Field `file` does not exist
Error context:
View `product.template.common.form.inherit`
[view_id: 2095, xml_id: module.view_product_form_inherit, model: product.template, parent_id: 402]
None" while parsing /home/omar/odoo/custom-addons/addons12/module/views/views.xml:403, near
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view"/>
<field name="arch" type="xml">
<xpath expr="//page[#name='inventory']/group" position="before">
<group col="2" colspan="2">
<field name="file"/>
</group>
</xpath>
</field>
</record>
1- First, check if the manifest.py file contains:
"depends": [
'product'
],
2- check if the name of your file that contains the class ClassProductInherited: exists in the init.py file like this for example:
from . import my_file
<record id="view_product_form_inherit" model="ir.ui.view">
<field name="name">product.template.common.form.inherit</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_form_view"/>
<field name="arch" type="xml">
<xpath expr="//field[#name='weight']" position="before">
<group>
<field name="file"/>
</group>
</xpath>
</field>
</record>
Try this piece of code and let me know if it works.
check in your .py file that you have to inherit only single module in one ... if you declare more than one module in single record so remove it. and make another record for another module. then after check it you declare or note the field file in your .py file

FIX 4.2 Tag Not Defined

20180216-17:21:04.640 : 8=FIX.4.2;9=115;35=V;34=3;49=SNDJ;52=20180216-17:21:04.640;56=BROKER;55=EUR/USD;146=1;262=676;263=1;264=1;265=1;266=Y;267=1;269=0;10=061;
20180216-17:21:04.641 : 8=FIX.4.2;9=119;35=3;34=3;49=BROKER;52=20180216-17:21:04.641;56=SNDJ;45=3;58=Tag not defined for this message type;371=55;372=V;373=2;10=237;
I receive 'tag not defined for this message type' rejects (35=3) when attempting to send 35=V messages. I have added and removed ValidateUserDefinedFields, ValidateFieldsOutOfOrder.
I have razed the group structure, re-added it, redefined both Symbol and NoRelatedSym types (to string, symbol, int, numingroup etc.), changed the symbol being sent to EURUSD, TEST, etc. and nothing works.
Have I missed something very simple here? It seems related to the fact that the request message puts the symbol tag ahead of the group, but I do not know why.
MarketDataRequest.h:
FIELD_SET(*this, FIX::NoRelatedSym);
class NoRelatedSym: public FIX::Group
{
public:
NoRelatedSym() :
FIX::Group(146,55,FIX::message_order(55,65,48,22,167,200,205,201,2
02,206,231,223,207,106,348,349,107,350,351,336,0)) {}
FIELD_SET(*this, FIX::Symbol);
....
};
My current FIX 4.2 .xml set up for MarketDataRequest messages looks like:
<message name='MarketDataRequest' msgtype='V' msgcat='app'>
<field name='MDReqID' required='Y' />
<field name='SubscriptionRequestType' required='Y' />
<field name='MarketDepth' required='Y' />
<field name='MDUpdateType' required='N' />
<field name='AggregatedBook' required='N' />
<group name='NoMDEntryTypes' required='Y'>
<field name='MDEntryType' required='Y' />
</group>
<group name='NoRelatedSym' required='Y'>
<field name='Symbol' required='Y' />
<field name='SymbolSfx' required='N' />
<field name='SecurityID' required='N' />
<field name='IDSource' required='N' />
<field name='SecurityType' required='N' />
<field name='MaturityMonthYear' required='N' />
<field name='MaturityDay' required='N' />
<field name='PutOrCall' required='N' />
<field name='StrikePrice' required='N' />
<field name='OptAttribute' required='N' />
<field name='ContractMultiplier' required='N' />
<field name='CouponRate' required='N' />
<field name='SecurityExchange' required='N' />
<field name='Issuer' required='N' />
<field name='EncodedIssuerLen' required='N' />
<field name='EncodedIssuer' required='N' />
<field name='SecurityDesc' required='N' />
<field name='EncodedSecurityDescLen' required='N' />
<field name='EncodedSecurityDesc' required='N' />
<field name='TradingSessionID' required='N' />
</group>
</message>
Configuration Settings:
[DEFAULT]
BeginString=FIX.4.2
ReconnectInterval=60
SocketAcceptPort=7091
SenderCompID=SNDJ
TargetCompID=BROKER
SocketNodelay=Y
PersistMessage=Y
FileStorePath=cache
FileLogPath=log
[SESSION]
ConnectionType=acceptor
StartTime=00:30:00
EndTime=23:30:00
ReconnectInterval=30
HeartBtInt=15
SocketAcceptPort=7091
SocketReuseAddress=Y
DataDictionary=spec/FIX42.xml
AppDataDictionary=spec/FIX42.xml
SenderCompID=BROKER
TargetCompID=SNDJ
FileStorePath=cache
FileLogPath=log
[SESSION]
BeginString=FIX.4.2
ConnectionType=initiator
StartTime=00:30:00
EndTime=23:30:00
ReconnectInterval=15
HeartBtInt=15
SocketConnectPort=7091
SocketConnectHost=127.0.0.1
DataDictionary=spec/FIX42.xml
AppDataDictionary=spec/FIX42.xml
SenderCompID=SNDJ
TargetCompID=BROKER
FileStorePath=cache
FileLogPath=log
Thanks
The message that you are sending is invalid per your own DD.
Look at the first body fields after the header ends:
55=EUR/USD;146=1;262=676;...
That 55 field is supposed to be inside the 146 repeating group, but its placement puts it prior to the group.
I suspect your config may be to blame. If you update your question to include the config, I will probably be able to see what's wrong and update this answer.
UPDATE:
You are missing UseDataDictionary=Y from your config, though that's not the cause of your problem. (You need it to receive messages correctly, though.)
Also, you don't need AppDataDictionary -- that's only for FIX 5+.

quickfix marketdatarequest parsing errors

I am using quickfix 1.14.0 on a linux machine. I am sending a MarketDataRequest. The request I am sending is
<message>
<header>
<field number="8">
<![CDATA[FIX.4.4]]>
</field>
<field number="35">
<![CDATA[V]]>
</field>
<field number="49">
<![CDATA[FixServer]]>
</field>
<field number="56">
<![CDATA[INCA]]>
</field>
</header>
<body>
<field number="146">
<![CDATA[1]]>
</field>
<field number="262">
<![CDATA[MARKETDATAID]]>
</field>
<field number="263">
<![CDATA[0]]>
</field>
<field number="264">
<![CDATA[0]]>
</field>
<field number="267">
<![CDATA[1]]>
</field>
<group>
<field number="55">
<![CDATA[LNUX]]>
</field>
</group>
<group>
<field number="269">
<![CDATA[0]]>
</field>
</group>
</body>
<trailer>
</trailer>
</message>
On the receiving end, I see the request coming in as
<message>
<header>
<field number="8">
<![CDATA[FIX.4.4]]>
</field>
<field number="9">
<![CDATA[112]]>
</field>
<field number="35">
<![CDATA[V]]>
</field>
<field number="34">
<![CDATA[93]]>
</field>
<field number="49">
<![CDATA[FixServer]]>
</field>
<field number="52">
<![CDATA[20150714-19:19:54.844]]>
</field>
<field number="56">
<![CDATA[INCA]]>
</field>
</header>
<body>
<field number="55">
<![CDATA[LNUX]]>
</field>
<field number="146">
<![CDATA[1]]>
</field>
<field number="262">
<![CDATA[MARKETDATAID]]>
</field>
<field number="263">
<![CDATA[0]]>
</field>
<field number="264">
<![CDATA[0]]>
</field>
<field number="267">
<![CDATA[1]]>
</field>
<field number="269">
<![CDATA[0]]>
</field>
</body>
<trailer>
<field number="10">
<![CDATA[151]]>
</field>
</trailer>
</message>
I am parsing the request using
FIX::MDReqID mdReqID;
FIX::SubscriptionRequestType subscriptionRequestType;
FIX::MarketDepth marketDepth;
FIX::NoRelatedSym noRelatedSym;
FIX44::MarketDataRequest::NoRelatedSym noRelatedSymGroup;
message.get( mdReqID );
message.get( subscriptionRequestType );
if ( subscriptionRequestType != FIX::SubscriptionRequestType_SNAPSHOT )
throw( FIX::IncorrectTagValue( subscriptionRequestType.getField() ) );
message.get( marketDepth );
message.get( noRelatedSym );
for ( int i = 0; i < noRelatedSym; ++i )
{
FIX::Symbol symbol;
message.getGroup( i, noRelatedSymGroup );
noRelatedSymGroup.get( symbol );
}
I get an exception when I try to get the noRelatedSymbolGroup. I see the following error message sent back to the requestor,
358=Conditionally Required Field Missing (146)
The code I am using is from the examples. I do not understand why the tag 55 appears before tag 146, even though it appears correctly from the sender side.
Any help is appreciated.
This looks like a configuration problem.
Your config should have these two lines:
UseDataDictionary=Y
DataDictionary=path/to/your/dd.xml
I bet the first line is missing.
The 55 is appearing before 146 because QF will internally rearrange the top-level fields in your message (because FIX does not care about the order of top-level fields).
55 is not top-level in MarketDataReq messages, but your bad configuration is telling QF that there are no repeating groups (because repeating groups require a DD). Thus QF is treating everything as a top-level field.

complex Bean IO record ,multi segments (0-n occurences) pipe delimited

I have a scenario to map user information to Map of Objects (Map or List).
I have say user info as follows
CommonHeader(CX) block followed by 0 or more ID blocks followed by 0 or more Address blocks
Below are valid formats for user records
CX|19981222|19981222|ID|DriversLicence|111111111|ID|Passport|ABC12345|AD|123 Main Street|Atlanta|GA|30316|AD|100 PeachTree RD|Atlanta|Ga|3007|
CX|19981222|19981222|ID|DriversLicence|111111111|ID|Passport|ABC12345|
CX|19981222|19981222|AD|123 Main Street|Atlanta|GA|30316|AD|100 PeachTree RD|Atlanta|Ga|3007|
Is it possible to map such scenarios using beanio ?
Whats the best solution to handle these cases ?
I am using Beanio-2.1
My beanio mapping file is as follows
<stream name="userrRecord" format="delimited">
<parser>
<property name="delimiter" value="|"/>
</parser>
<record name="urecord" class="map" minOccurs="0" maxOccurs="unbounded" >
<segment name="CX" class="map">
<field name="CX"/>
<field name="DateFirstReported" type="date" format="yyyyMMdd"/>
<field name="DateLastReported" type="date" format="yyyyMMdd"/>
</segment>
<segment name="ID" class="map" minOccurs="0" maxOccurs="unbounded" collection="list">
<field name="ID"/>
<field name="IDType"/>
<field name="DocumentID"/>
</segment>
< segment name="AD" class="map" minOccurs="0" maxOccurs="unbounded" collection="list">
<field name="AD"/>
<field name="Street"/>
<field name="City"/>
<field name="State"/>
<field name="Zipcode"/>
</segment>
</record>
</stream>
When I try to unmarshall a record with 2 ID segmenst and 0 AD segments running into InvalidRecord exception.
Any help is highly appreciated.
I think this is not possible, as stated in the BeanIO Reference Guide:
Flat file formats (CSV, delimited and fixed length) may only contain one
field or segment of indeterminate length (i.e. where maxOccurs is greater
than minOccurs). The position of components that follow are assumed to be
relative to the end of the record.
You should change each of your segments to a separate record, and wrap it in a group. Then your sample input will look like this:
CX|19981222|19981222|
ID|DriversLicence|111111111|
ID|Passport|ABC12345|
AD|123 Main Street|Atlanta|GA|30316|
AD|100 PeachTree RD|Atlanta|Ga|3007|
CX|19981222|19981222|
ID|DriversLicence|111111111|
ID|Passport|ABC12345|
CX|19981222|19981222|
AD|123 Main Street|Atlanta|GA|30316|
AD|100 PeachTree RD|Atlanta|Ga|3007|
And your mapping like this:
<stream name="userrRecord" format="delimited">
<parser>
<property name="delimiter" value="|"/>
</parser>
<group name="urecord" class="map" minOccurs="0" maxOccurs="unbounded">
<record name="CX" class="map">
<field name="CX"/>
<field name="DateFirstReported" type="date" format="yyyyMMdd"/>
<field name="DateLastReported" type="date" format="yyyyMMdd"/>
</record>
<record name="ID" class="map" minOccurs="0" maxOccurs="unbounded" collection="list">
<field name="ID"/>
<field name="IDType"/>
<field name="DocumentID"/>
</record>
<record name="AD" class="map" minOccurs="0" maxOccurs="unbounded" collection="list">
<field name="AD"/>
<field name="Street"/>
<field name="City"/>
<field name="State"/>
<field name="Zipcode"/>
</record>
</group>
</stream>

get offline messages of publisher

I have implemented XEP-0060 pubsub using openfire , i am able to publish messages over an existing node and i have other subscribers who can get those published messages.
now the issue is , i am not be able to receiver the old messages i mean if the subscribers are offline and when they come back online then how can i get the old messages which were being published by the publisher long time back.
My node on which publishers are publishing is configured as follows
<iq from="pubsub.example.com" type="result" id="meta1" to="lime#example.com/localhost">
<query xmlns="http://jabber.org/protocol/disco#info" node="mynode/loc">
<identity category="pubsub" type="leaf"/>
<feature var="http://jabber.org/protocol/pubsub"/>
<feature var="http://jabber.org/protocol/disco#info"/>
<x xmlns="jabber:x:data" type="result">
<field type="hidden" var="FORM_TYPE">
<value>http://jabber.org/protocol/pubsub#meta-data</value>
</field>
<field type="text-single" label="Short name for the node" var="pubsub#title">
<value/>
</field>
<field type="text-single" label="Description of the node" var="pubsub#description">
<value/>
</field>
<field type="boolean" label="Allow subscriptions to node" var="pubsub#subscribe">
<value>1</value>
</field>
<field type="boolean" label="New subscriptions require configuration" var="pubsub#subscription_required">
<value>0</value>
</field>
<field type="boolean" label="Deliver payloads with event notifications" var="pubsub#deliver_payloads">
<value>1</value>
</field>
<field type="boolean" label="Notify subscribers when the node configuration changes" var="pubsub#notify_config">
<value>1</value>
</field>
<field type="boolean" label="Notify subscribers when the node is deleted" var="pubsub#notify_delete">
<value>1</value>
</field>
<field type="boolean" label="Notify subscribers when items are removed from the node" var="pubsub#notify_retract">
<value>1</value>
</field>
<field type="boolean" label="Only deliver notifications to available users" var="pubsub#presence_based_delivery">
<value>0</value>
</field>
<field type="text-single" label="Type of payload data to be provided at this node" var="pubsub#type">
<value/>
</field>
<field type="text-single" label="Message body XSLT" var="pubsub#body_xslt">
<value/>
</field>
<field type="text-single" label="Payload XSLT" var="pubsub#dataform_xslt">
<value/>
</field>
<field type="list-single" label="Specify who may subscribe and retrieve items" var="pubsub#access_model">
<option>
<value>authorize</value>
</option>
<option>
<value>open</value>
</option>
<option>
<value>presence</value>
</option>
<option>
<value>roster</value>
</option>
<option>
<value>whitelist</value>
</option>
<value>open</value>
</field>
<field type="list-single" label="Publisher model" var="pubsub#publish_model">
<option>
<value>publishers</value>
</option>
<option>
<value>subscribers</value>
</option>
<option>
<value>open</value>
</option>
<value>open</value>
</field>
<field type="list-multi" label="Roster groups allowed to subscribe" var="pubsub#roster_groups_allowed"/>
<field type="jid-multi" label="People to contact with questions" var="pubsub#contact"/>
<field type="text-single" label="Default language" var="pubsub#language">
<value>English</value>
</field>
<field type="jid-multi" label="Node owners" var="pubsub#owner">
<value>mypublisher#example.com</value>
</field>
<field type="jid-multi" label="Node publishers" var="pubsub#publisher"/>
<field type="list-single" label="Select entity that should receive replies to items" var="pubsub#itemreply">
<value>owner</value>
</field>
<field type="jid-multi" label="Multi-user chat room to which replies should be sent" var="pubsub#replyroom"/>
<field type="jid-multi" label="Users to which replies should be sent" var="pubsub#replyto"/>
<field type="boolean" label="Send items to new subscribers" var="pubsub#send_item_subscribe">
<value>1</value>
</field>
<field type="boolean" label="Persist items to storage" var="pubsub#persist_items">
<value>1</value>
</field>
<field type="text-single" label="Max number of items to persist" var="pubsub#max_items">
<value>5</value>
</field>
<field type="text-single" label="Max payload size in bytes" var="pubsub#max_payload_size">
<value>5120</value>
</field>
</x>
</query>
</iq>
yeah i got it , when the subscriber gets online using following stanza he/she can retrive the old published items
subid is must in this case
<iq type='get'
from='subscriber#example.com'
to='pubsub.example.com'
id='items1'>
<pubsub xmlns='http://jabber.org/protocol/pubsub'>
<items node='mynode'
subid="8839399494949"/>
</pubsub>
</iq>