From: Sandhu, B. <Bal...@rb...> - 2011-01-12 17:06:26
|
Hi Thanks for responding. The 'SocketTcpNoDelay' seems to have a default value of Y, according to the user guide. I am posting some relevant code. Maybe you can spot a problem. ============== Initiator ============== On the client side (initiator) we have MessageListener and MessageSender abstractions. ----Message Listener---- @Override public final void onMessage(SessionID sessionId, Message message) { log.trace(sessionId + " >> " + message); try { crack(message, sessionId); } catch (Exception e) { log.debug(e.getMessage(), e); throw new FixException(e); } } @Override public void onMessage(Quote quote, @SuppressWarnings("unused") SessionID sessionId) { try { FiQuote fiQuote = messageCodec.decodeQuote(quote); log.info(addInfo(fiQuote.getId(), "FI Quote received", fiQuote.getUserId())); quoteResponseListener.onQuote(fiQuote); // This goes into a workflow where we lock the quote object // inorder to process it } catch (Exception e) { throw new FixException(e); } } ----MessageSender---- @Override public final void send(Message message) { if (sessionId == null) { throw new FixSessionNotInitializedException("FIX session is not established for " + cmdirectId + ". Verify that FIX server is up and running"); } if(log.isDebugEnabled()){ log.debug(sessionId + " << " + message); } try { Session.sendToTarget(message, sessionId); } catch (Exception e) { log.debug(e.getMessage(), e); throw new FixException(e); } } -----Config----- [DEFAULT] ConnectionType=initiator BeginString=FIX.4.4 HeartBtInt=30 ReconnectInterval=5 SenderCompID=TEST_CLIENT [SESSION] CMDirectID=RFQ_SESSION TargetCompID=TEST_SERVER ResetOnLogout=Y SendResetSeqNumFlag=Y ResetOnLogon=Y TimeZone=America/New_York EndTime=00:00:00 StartTime=00:00:00 SocketConnectHost=ulcmdrd1.devfg.rbc.com SocketConnectPort=9876 PersistMessages=Y UseDataDictionary=Y DataDictionary=FIX44_Eddie.xml ValidateUserDefinedFields=Y SocketSendBufferSize=32768 SocketReceiveBufferSize=32768 ============== Acceptor ============== public void fromApp(quickfix.Message message, SessionID sessionId) throws FieldNotFound, IncorrectTagValue, UnsupportedMessageType { log.info("Got from FIX client: " + sessionId + " >>" + formatMessage(message, sessionId)); taskExecutor.execute(new ProcessTask(message, sessionId)); } @Override public void onMessage(QuoteRequest quoteRequest, SessionID sessionId) { try { Quote quote = createQuote(quoteRequest); log.debug("Sending Quote: " + sessionId + " << " + quote); Session.sendToTarget(quote, sessionId); } catch (Exception e) { handleErrors(e); } } private class ProcessTask implements Runnable { private final Message message; private final SessionID sessionId; public ProcessTask(Message message, SessionID sessionId) { this.message = message; this.sessionId = sessionId; } @Override public void run() { onMessage(message, sessionId); } } -----Config----- [DEFAULT] ConnectionType=acceptor BeginString=FIX.4.4 SenderCompID=TEST_SERVER DataDictionary=FIX44_Eddie.xml TimeZone=America/New_York StartTime=00:00:00 EndTime=00:00:00 SocketAcceptPort=9876 PersistMessages=Y SocketSendBufferSize=32768 SocketReceiveBufferSize=32768 Thanks heaps Baljeet -----Original Message----- From: th...@co... [mailto:th...@co...] Sent: 2011, January, 11 6:47 PM To: qui...@li... Subject: Re: [Quickfixj-users] Performance hints QuickFIX/J Documentation: http://www.quickfixj.org/documentation/ QuickFIX/J Support: http://www.quickfixj.org/support/ ________________________________________ This E-Mail (including any attachments) may contain privileged or confidential information. It is intended only for the addressee(s) indicated above. The sender does not waive any of its rights, privileges or other protections respecting this information. Any distribution, copying or other use of this E-Mail or the information it contains, by other than an intended recipient, is not sanctioned and is prohibited. If you received this E-Mail in error, please delete it and advise the sender (by return E-Mail or otherwise) immediately. This E-Mail (including any attachments) has been scanned for viruses. It is believed to be free of any virus or other defect that might affect any computer system into which it is received and opened. However, it is the responsibility of the recipient to ensure that it is virus free. The sender accepts no responsibility for any loss or damage arising in any way from its use. E-Mail received by or sent from RBC Capital Markets is subject to review by Supervisory personnel. Such communications are retained and may be produced to regulatory authorities or others with legal rights to the information. IRS CIRCULAR 230 NOTICE: TO COMPLY WITH U.S. TREASURY REGULATIONS, WE ADVISE YOU THAT ANY U.S. FEDERAL TAX ADVICE INCLUDED IN THIS COMMUNICATION IS NOT INTENDED OR WRITTEN TO BE USED, AND CANNOT BE USED, TO AVOID ANY U.S. FEDERAL TAX PENALTIES OR TO PROMOTE, MARKET, OR RECOMMEND TO ANOTHER PARTY ANY TRANSACTION OR MATTER. |