QuickFix/N: How to have typed messages when using FIXT1.1 with FIX5.0? - quickfixn

Context
I have a test Acceptor and Initiator. I am using QuickFix/N 1.7 release. Everything works fine, if I configure both Acceptor and Initiator to FIX 4.4.
Doing nothing, just connecting, then logging the incoming/outgoing heartbeat messages to the debug console. All OK, see below.
I change nothing just the two configuration files accordingly from FIX 4.4 to FIX 5.0. All works (I mean the heartbeat messages still coming and going), but the message parameter of the callback is not a typed (heartbeat) runtime instance message anymore, instead the base class.
Diagnostics:
All referenced specification files are in place. If I intentionally ruin a character either in TransportDataDictionary path or AppDataDictionary I got the expected exception
Using the out of the box specification files, no customization at all.
Question:
Why the message instance is not a typed runtime instance message in the FIX 5.0 case and typed in the FIX 4.4 case?
Is this the expected behavior or am I missing something?
Code Exhibits:
Code in Initiator IApplication implementation which produces the output lines:
public void ToAdmin(Message message, SessionID sessionID)
{
Debug.WriteLine($#"(A)OUT: {message.GetType()}{message}");
}
public void FromAdmin(Message message, SessionID sessionID)
{
Debug.WriteLine($#"(A)IN: {message.GetType()}{message}");
}
When using the 4.4 configuration then I see this: (message type is QuickFix.FIX44.Heartbeat)
Logon - FIX.4.4:TEST01->MYACCEPTOR
(A)IN: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=249=MYACCEPTOR52=20170715-15:00:31.59656=TEST0110=179
(A) OUT: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=249=TEST0152=20170715-15:00:31.60456=MYACCEPTOR10=169
(A) OUT: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=349=TEST0152=20170715-15:00:36.61056=MYACCEPTOR10=172
(A) IN: QuickFix.FIX44.Heartbeat8=FIX.4.4 9=5335=034=349=MYACCEPTOR52=20170715-15:00:36.61556=TEST0110=177
When using the 5.0 and configuration then I see this: (message type is just QuickFix.FIX50.Message)
Logon - FIXT.1.1:TEST01->MYACCEPTOR
(A)IN: QuickFix.Message8=FIXT.1.19=5335=034=249=MYACCEPTOR52=20170715-15:06:16.92256=TEST0110=003
(A) OUT: QuickFix.Message8=FIXT.1.19=5335=034=249=TEST0152=20170715-15:06:16.93056=MYACCEPTOR10=002
(A) OUT: QuickFix.Message8=FIXT.1.19=5335=034=349=TEST0152=20170715-15:06:21.93656=MYACCEPTOR10=005
(A) IN: QuickFix.Message8=FIXT.1.19=5335=034=349=MYACCEPTOR52=20170715-15:06:21.94156=TEST0110=001
FIX5.0 configuration for Intiator:
[DEFAULT]
ConnectionType=initiator
ReconnectInterval=2
FileStorePath=store
FileLogPath=log
StartTime=00:00:00
EndTime=00:00:00
UseDataDictionary=Y
TransportDataDictionary=..\spec\FIXT11.xml
AppDataDictionary=..\spec\FIX50.xml
SocketConnectHost=127.0.0.1
SocketConnectPort=1111
LogoutTimeout=5
ResetOnLogon=Y
ResetOnDisconnect=Y
[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0
SenderCompID=TEST01
TargetCompID=MYACCEPTOR
HeartBtInt=5
FIX5.0 configuration for Acceptor:
[DEFAULT]
ConnectionType=acceptor
SocketAcceptPort=1111
StartTime=00:00:00
EndTime=00:00:00
FileLogPath=log
UseDataDictionary=Y
ResetOnLogon=Y
ResetOnLogout=Y
ResetOnDisconnect=Y
[SESSION]
BeginString=FIXT.1.1
DefaultApplVerID=FIX.5.0
SenderCompID=MYACCEPTOR
TargetCompID=TEST01
FileStorePath=store
TransportDataDictionary=..\spec\FIXT11.xml
AppDataDictionary=..\spec\FIX50.xml

The data dictionary for FIX4.4 at quickfixn repository contains -
<message name="Heartbeat" msgtype="0" msgcat="admin">
<field name="TestReqID" required="N" />
</message>
which is the formal definition of Heartbeat message.
This definition is missing in the FIX 5.0 data dictionary, causing the quickfix engine to consider it as a generic message.
Adding the heartbeat message definition to the FIX 5.0 data dictionary should solve your problem.

Related

Undeclared namespace prefix "soapenv" error while using web service consumer

I am using web service consumer in Mule4 and after configuration and deployed the application and triggered the target ARIBA SOAP service in logs I see below error:
org.apache.cxf.binding.soap.SoapFault: Error reading XMLStreamReader: Undeclared namespace prefix "soapenv"
at [row,col {unknown-source}]: [1,14]
When i explored the error I see it is an issue at target system end:], please let me know whether it is end system thrown error or any pointers on what would cause this issue
enter link description here
The link you shared seems pretty clear. It is an issue on SAP Ariba side. The solution is also shared in the same page:
The error message is as follows:
<fault xmlns="http://www.bea.com/wli/sb/context">
<errorCode>OSB-380001</errorCode>
<reason>java.lang.RuntimeException: javax.xml.soap.SOAPException: Error parsing
envelope: most likely due to an invalid SOAP message.: Undeclared namespace prefix
"soapenv" at [row,col {unknown-source}]: [1,14] </reason>
For some reason Ariba doesn't seem to be declaring the SOAP XML namespaces in its responses.
If you receive the invalid soap message response error or some other invocation error from Ariba, you must enable the following property in the Ariba sand box.
Application.Messaging.Channels.Util.IncludeNameSpaceDetailsInErrorResponse
You have to follow the instructions to configure Ariba to include the namespaces in responses.

How to avoid printing this WARN message in JBoss

My logs are getting hammered by below log message in JBOSS 7. Can you anyone suggest how to stop this log message.
2018-02-28 13:37:13,618 WARN [com.arjuna.ats.arjuna] (default-threads - 48) ARJUNA012141: Multiple last resources have been added to the current transaction. This is transactionally unsafe and should not be relied upon. Current resource is LastResourceRecord(XAOnePhaseResource(LocalXAResourceImpl#5d70439b[connectionListener=653eac5d connectionManager=7f6856e8 warned=false currentXid=null productName=MySQL productVersion=10.2.13-MariaDB-log jndiName=java:/jdbc/db_jndi]))
In your standalone.xml file, in the logging section, add something like this under the appropriate handler element:
<filter>
<not>
<match pattern="ARJUNA012141"/>
</not>
</filter>
Of course, you should add these lines using the jboss-cli utility. Did you know that changes to logging don't require a server restart, but will be picked up at the defined refresh interval?

OpenJPA PersistenceException in Liberty 8.5.5.3 Profile due to invalid URL

I have just found an annoying mistake I made during the configuration of the DB2 JCC Properties in the "server.xml" of my Liberty Profile v8.5.5.3 which I wanted to share with you since it took me a long time searching the Web for helpful hints.
I configured a DB2 Datasource for JPA access in the "server.xml" using the Liberty Developer Tools in Eclipse Luna (Design tab): The "DB2 JCC Properties" are not sorted very clearly in my opinion. The required DB user name and password are not listed next to each other and made it hard for me to identify the correct properties. I unfortunately entered the DB user name in the field "Client User" instead of in "User" which is located nearly at the end of the list.
The thrown exception was:
<openjpa-2.2.3-SNAPSHOT-r422266:1595313 nonfatal general error> org.apache.openjpa.persistence.PersistenceException: There were errors initializing your configuration: <openjpa-2.2.3-SNAPSHOT-r422266:1595313 fatal user error> org.apache.openjpa.util.UserException: A connection could not be obtained for driver class "null" and URL "null". You may have specified an invalid URL.
at org.apache.openjpa.jdbc.schema.DataSourceFactory.newConnectException(DataSourceFactory.java:255)
at org.apache.openjpa.jdbc.schema.DataSourceFactory.installDBDictionary(DataSourceFactory.java:241)
at org.apache.openjpa.jdbc.conf.JDBCConfigurationImpl.getConnectionFactory(JDBCConfigurationImpl.java:733)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:94) ... ... at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1176)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:795) Caused by: java.sql.SQLNonTransientException: [jcc][t4][10205][11234][4.18.60] Null userid is not supported. ERRORCODE=-4461, SQLSTATE=42815 DSRA0010E: SQL State = 42815, Error Code = -4,461
at com.ibm.db2.jcc.am.kd.a(kd.java:747)}
This exception indicates an incorrect connection URL: "You may have specified an invalid URL." but "A connection could not be obtained for driver class 'null' and URL 'null'" really pointed me in the wrong direction.
I recommend using the Source tab instead of the Design tab in the Liberty profile configuration tools and edit the XML entries manually to avoid wrong configuration values that may lead to confusion, e.g.
<server description="new server">
<!-- Enable features -->
<featureManager>
<feature>jsp-2.2</feature>
<feature>jdbc-4.0</feature>
<feature>jpa-2.0</feature>
</featureManager>
<httpEndpoint httpPort="9080" httpsPort="9443" id="defaultHttpEndpoint"/>
<applicationMonitor updateTrigger="mbean"/>
<dataSource id="DB2Connection" jndiName="jdbc/DB2Connection">
<jdbcDriver libraryRef="DB2jdbc4libs"/>
<properties.db2.jcc user="Administrator" databaseName="CUSTDB" password="{xor}password" portNumber="50000" serverName="dbserver.mycompany.com"/>
</dataSource>
<library id="DB2jdbc4libs">
<fileset caseSensitive="true" dir="/opt/db2/V10.5/java" includes="db2jcc_license_cu.jar, db2jcc.jar"/>
</library>
<webApplication id="DynWebJPASample" location="DynWebJPASample.war" name="DynWebJPASample"/>

enterprise library 3.1 - if one listener is failed then subsequent listener will be never executed

I am using Msmqdistributor service of Enterprise Library 3.1 to distribute logs from various application.I have defined multiple listeners in categorySources/specialSources, but if one listener is failed than subsequent listeners will be never executed.
Following is my config code.
<specialSources>
<allEvents switchValue="Warning" name="All Events">
<listeners>
<add name="Database Listener A" />
<add name="Custom Trace Listener A" />
<add name="Custom Trace Listener B" />
</listeners>
</allEvents>
<notProcessed switchValue="Warning" name="Unprocessed Category" />
<errors switchValue="Warning" name="Logging Errors & Warnings"/>
</specialSources>
If I am specifying wrong connection string for Database Listener A then it will be failed to insert logs in database. But it also stops the jobs of next Custom Trace Listener A and Custom Trace Listener B.So here Custom Trace Listener A and Custom Trace Listener B will be never executed if Database Listener A is failed.
Anybody can help please ?
Thanks
Mitesh Patel
This behavior seems to be "by design". See the answer for Microsoft Enterprise Library 4.1 Logging Fails on Windows XP SP3.
Of course, this doesn't really help you. One workaround would be to attach one listener to a category. So for your 3 listeners you could add 3 categories. This will work but is not particularly elegant.
Since you indicate that you are using 2 custom trace listeners another approach to mitigate the issue would be to code the custom trace listeners to swallow any exceptions (not usually a good idea, though). You could also order your trace listeners from least likely to fail to most likely to fail. E.g. Database > Event Log > Flat File. In your scenario place the custom trace listeners before the database trace listener.
It is also good practice to add a trace listener to the errors category. Not sure if you have that in your app or not (but the posted config doesn't).

How to configure MessageEndpointMapping by namespace in NServiceBus

I am trying to configure my message endpoint mapping in my NServiceBus configuration by sending messages from different namespaces to different endpoints.
As such, I have configured the following in my web.config:
<MessageEndpointMappings>
<add Messages="Company.Messages.Accounts" Endpoint="ServiceInput" />
<add Messages="Company.Messages.Payments" Endpoint="ServiceInput" />
<add Messages="Company.Messages.Cancellations" Endpoint="ServiceInput" />
<add Messages="Company.Messages.Notifications" Endpoint="ServiceInput" />
</MessageEndpointMappings>
However, when my application starts, I receive the following exception:
Spring.Objects.PropertyAccessExceptionsException: PropertyAccessExceptionsException (1 errors); nested PropertyAccessExceptions are:
[Spring.Core.TypeMismatchException: Cannot convert property value of type [System.Collections.Hashtable] to required type [System.Collections.IDictionary] for property 'MessageOwners'., Inner Exception: System.ArgumentException: Problem loading message assembly: Company.Messages.Payments ---> System.IO.FileNotFoundException: Could not load file or assembly 'Company.Messages.Payments' or one of its dependencies. The system cannot find the file specified.
File name: 'Company.Messages.Payments'
What I find interesting is that it seems to have found Company.Messages.Accounts but failed on the second configured line. I thought that maybe it didn't like have them all go to the same endpoint, but changing this configuration to have them go different endpoints didn't change the error message I received.
What am I doing wrong? Is it not possible to segment messages by namespace (all I have seen is by type and by assembly)?
Thanks,
Steve
NSB only supports mapping of assemblies or individual types to endpoints. Namespaces are not supported, I suggest you split you message assembly into separate assemblies for each of your endpoints.
According to this page you can specify a type:
http://docs.particular.net/nservicebus/messaging/message-owner
Specific types can be configured by using their qualified name: "namespace.type, assembly".
As of NServiceBus v3.3 namespaces can be used to filter message mappings
http://docs.particular.net/nservicebus/messaging/message-owner