FAQ

I need to continue the FIX Session starting from the specific message sequence number, but I have deleted the log files from the previous runs. How can I do this?

You can use session InSeqNum and OutSeqNum properties to set the start sequence numbers before establishing the session.

Can I have multiple session objects per engine?

Yes, you can have multiple session objects per engine instance.

What is the thread model for individual session object: are incoming events all sent from the same thread?

Yes, all incoming events related to a particular session are sent from the same thread.

Can session event listeners be heavyweight? I.e. would I be looking to fork a thread to avoid holding up receipt of further events?

It is important to avoid time-consuming tasks inside session event handlers. Thus, you should fork a thread and listener can't be heavyweight.

How can I send non-ASCII text field values (i.g. Arabic)?

The fields that start with the “Encoded” prefix should be used.

For example:

During message creation the following approach can be used:

39
40
41
42
final String text = "string using local charset";
final byte[] encodedText = text.getBytes(StandardCharsets.UTF_8);
order.set(Tag.EncodedTextLen, encodedText.length);
order.set(Tag.EncodedText, encodedText);

During message processing the following approach can be used:

47
48
49
final byte[] encodedText = order.getBytes(Tag.EncodedText);
final String charset = "cp1251";
final String text = new String(encodedText, charset);

How can I change value of the SendingTime(52) field in the outgoing message?

By default the FIX Engine automatically sets the SendingTime(52) field value to the current date and time using UTC+0 time zone.

This can be overridden in the session listener.

32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
public class SendingTimeModificator implements Session.OutboundApplicationMessageListener {
    public static void main(String[] args) {
        final Engine engine = Engine.init();
        final Session session = new Session("InitiatorCompId", "AcceptorCompId", Version.FIX50_SP2);
        session.setOutboundApplicationMessageListener(new SendingTimeModificator());
        engine.shutdown();
    }
  
    @Override
    public void onOutboundApplicationMessage(Object sender, Session.OutboundApplicationMessageArgs args) {
        final LocalDateTime sendingTime = ZonedDateTime.now(ZoneOffset.of("UTC+5")).toLocalDateTime();
        final Message message = args.getMsg();
        message.set(Tag.SendingTime, sendingTime);
    }
}

Meaning of “Cannot logon: after sending the initial Logon message the telecommunication link error is detected (closed by the counterparty).”

It means that the TCP connection was established and the initial Logon (MsgType=A) FIX message was sent, but after that the TCP connection was closed by the counterparty.

So we would recommend to contact your counterparty FIX support team and provide them with your FIX message log file (*.summary) and ask them what you need to change (if anything) in your initial Logon (MsgType=A) in order to establish the FIX session successfully.

Maybe they need to update the configuration settings on their side in order to accept your FIX connection (e.g. update login/password settings or the expected source IP address).

We need to connect to multiple exchanges (ICE, CME, LME) from the same engine instance. Can you tell me how I can achieve this?

The recommended approach is:

  • create a single configuration file containing
    • all required FIX dialects
    • engine-level settings
  • initialize the engine using configuration file
  • create session object for each destination
  • customize each session object properties depending on the requirements

How to limit the maximum resend request range?

For example, the CME has a restriction of not allowing client to ask for a resend span bigger than 2500 messages.

This can be achieved on the engine level:

29
30
31
final EngineSettings settings = new EngineSettings();
settings.setSessionResendRequestMaximumRange(2500);
final Engine engine = Engine.init(settings);

Or on the session level:

35
session.setResendRequestMaximumRange(2500);

The reference tickets are: JAVA-648.

How to create multiple sessions with the same SenderCompID and TargetCompID ?

You can specify different tokens for the sessions with the same SenderCompID and TargetCompID.

Please see parameter token of the biz.onixs.fix.engine.Session.Session(String, String, Version, boolean, String) session constructor.

How to change the order of tags in the FIX message ?

You should create corresponding dialect with the changed order of tags where “mode” of the messages set as “override”. Please see also Dialect docs section.