Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8752101
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:10:16+00:00 2026-06-13T13:10:16+00:00

I have created two classes: Initiator and Acceptor. I want to send messages from

  • 0

I have created two classes: Initiator and Acceptor. I want to send messages from the initiator to the acceptor and then process the received messages. I can’t send message.

This is my initiator.java

SocketInitiator socketInitiator = null;
String fileName = "conf/intiator.cfg";
try {
    SessionSettings initiatorSettings = new SessionSettings(new FileInputStream(fileName));
    Application initiatorApplication = new Initiator();
    FileStoreFactory fileStoreFactory = new FileStoreFactory(
            initiatorSettings);
    FileLogFactory fileLogFactory = new FileLogFactory(
            initiatorSettings);
    MessageFactory messageFactory = new DefaultMessageFactory();
    socketInitiator = new SocketInitiator(initiatorApplication, fileStoreFactory, initiatorSettings, fileLogFactory, messageFactory);
    socketInitiator.start();
    Message msg = new Message();
    msg.setString(1, "Hello this is test Message");


    SessionID sessionId = (SessionID) socketInitiator.getSessions().get(0);
    Session.lookupSession(sessionId).logon();
    initiatorApplication.onLogon(sessionId);
    initiatorApplication.toApp(msg, sessionId);
} catch (Exception e) {
    e.printStackTrace();
}

Here is its overRide message of Application Interface.

public void toApp(Message message, SessionID sessionId) throws DoNotSend {
    try {
        boolean result = quickfix.Session.sendToTarget(message, sessionId);
        if (result) {
            System.out.println("Message ahs send :)");
        } else {
            System.out.println("Not Send");
        }
    } catch (Exception e) {
        e.printStackTrace();
    }

}

this is initiator initiator.cfg file

[default]
StartTime=00:00:01
EndTime=23:59:59
HeartBtInt=10
SocketUseSSL=N
MillisecondsInTimeStamp=Y
FileIncludeMilliseconds=Y
CheckLatency=N
SocketTcpNoDelay=Y 


[session]
BeginString=FIX.4.4
ConnectionType=initiator
DisableQuickFixReconnLogic=Y
AdapterUserIndex=0

SocketConnectHost=127.0.0.1

Timezone=America/New_York

SocketConnectPort=3000
UseDataDictionary=Y
DataDictionary=conf/resources/FIX44.xml
ValidateFieldsOutOfOrder=N
ValidateFieldsHaveValues=N
ValidateUserDefinedFields=N
LogonTimeout=10
FileStorePath=conf/connector
FileLogPath=conf/connector/logs
FileLogBackupPath=conf/connector
ResetOnLogout=Y
ResetOnDisconnect=N
SendResetSeqNumFlag=Y
RawData=fxall123
#SessionQualifier=FXallStream
MillisecondsInTimeStamp=Y
FileIncludeMilliseconds=Y

[session]
BeginString=FIX.4.4
ConnectionType=initiator
DisableQuickFixReconnLogic=Y
AdapterUserIndex=1
SenderCompID=initiator-id
#SenderSubID=trader1
#TargetCompID=target-id
#TargetSubID=qftrade

SocketConnectHost=127.0.0.1
Timezone=America/New_York
#SocketConnectPort=443
SocketConnectPort=3000
UseDataDictionary=Y
DataDictionary=conf/resources/FIX44.xml
ValidateFieldsOutOfOrder=N
ValidateFieldsHaveValues=N
ValidateUserDefinedFields=N
LogonTimeout=5
FileStorePath=conf/connector
FileLogPath=conf/connector
FileLogBackupPath=conf/connector/backup
ResetOnLogout=Y
ResetOnLogon=Y
ResetOnDisconnect=N
SendResetSeqNumFlag=Y
RawData=fxall123
#SessionQualifier=FXallTrade

Acceptor.java

String fileName = "conf/acceptor.cfg";
SocketAcceptor socketAcceptor = null;
try {
    FileInputStream is = new FileInputStream(fileName);
    SessionSettings executorSettings = new SessionSettings(is);
    Application application = new Acceptor();
    FileStoreFactory fileStoreFactory = new FileStoreFactory(
            executorSettings);
    MessageFactory messageFactory = new DefaultMessageFactory();
    FileLogFactory fileLogFactory = new FileLogFactory(executorSettings);
    socketAcceptor = new SocketAcceptor(application, fileStoreFactory,
            executorSettings, fileLogFactory, messageFactory);
    socketAcceptor.start();

    SessionID sessionId = (SessionID) socketAcceptor.getSessions().get(0);
    application.onLogon(sessionId);
    int[] i = {1, 2, 3, 4, 5};

    // application.fromApp(new Message(i), sessionId);
} catch (Exception e) {
    e.printStackTrace();
}

acceptor.cfg

[default]
StartTime=00:00:00
EndTime=23:50:00
HeartBtInt=10
ReconnectInterval=6
SocketUseSSL=N
MillisecondsInTimeStamp=Y
CheckLatency=N
SocketTcpNoDelay=N
SocketAcceptAddress=127.0.0.1
SocketAcceptPort=3000

[session]
BeginString=FIX.4.4
ConnectionType=acceptor
#DisableQuickFixReconnLogic=Y
AdapterUserIndex=0
SenderCompID=target-id
#SenderSubID=qfstream
#TargetCompID=inttest
#TargetSubID=trader1
Timezone=America/New_York
UseDataDictionary=Y
DataDictionary=conf/resources/FIX44.xml
ValidateFieldsOutOfOrder=N
ValidateFieldsHaveValues=N
ValidateUserDefinedFields=N
LogonTimeout=5
FileStorePath=conf/Acceptor
FileLogPath=conf/Acceptor/logs
ResetOnLogout=Y
ResetOnDisconnect=N
SendResetSeqNumFlag=Y

Can anyone tell me where is the problem. Either in configuration or in code?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:10:17+00:00Added an answer on June 13, 2026 at 1:10 pm

    you need to make changes in xml file. I guess a field that you are using is not declared in fix.4.4 file. Check your xml file and include that in following way.

    i-e you want to send QuoteID with Currency, but in Currency QuoteID is not declared. In that case you will not be able to send message.
    you need to decleared that field(QuoteID) in fix.4.4/or any version you are using.

    <Currency>
    //
    //   
    <field name="QuoteID" required="N" /> // N or Y depend on your requirement 
    //
    //
    </currency>
    

    also check log, You will find error message there.

    May be you are not including require fields that can also create problem.
    use Following link to check which fields are required.
    http://www.fixprotocol.org/FIXimate3.0/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created two classes. I want to have a button on class 1
I have created two viewController classes such that one is superclass of another.i have
Say I have two classes created work and workItem. CWorker *work = new CWorker();
I have two classes with many-to-many relation so I created a join table in-between
I have two model classes, say parent and child. Parents are created first, and
I have created two WindowSurface (WPF), and I want to navigate betwen them. I've
I have created two classes, class A that uses a Linked List and class
good morning, I was trying the SharedPreferences Class and I have created two classes,
i have created two classes Standard and Family which extend abstract class Room ,
I have created two partial classes for a web page. Now i have given

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.