[QFJ-611] SessionNotFound, while still getting heartbeats Created: 21/Jun/11  Updated: 24/Mar/14  Resolved: 24/Mar/14

Status: Closed
Project: QuickFIX/J
Component/s: None
Affects Version/s: 1.5.0
Fix Version/s: None

Type: Other Priority: Default
Reporter: Willis Todd Assignee: Unassigned
Resolution: Not a bug Votes: 0
Labels: QuickfixJ, session
Environment:

Windows XP, Eclipse SDK Version: 3.5.2



 Description   

I am converting my app to connect to a different platform (Integral) from where I already have it working (Fortex), but I am catching a SessionNotFound when I try to send a MarketDataRequest to Integral and not when I use the same code to request data from Fortex. The only difference between the two is in the config files, which are identical other than the obvious login credentials for the two different platforms, and for Integral I have "SocketUseSSL=Y" and I am using FIX 4.3 instead of FIX 4.4. Even after I am told that the session does not exist, I continue to send and receive heartbeats for both sessions, so how am I getting a SessionNotFound and what can I do to correct it? Thanks in advance for your help!

Here is the code:

private void send2(Message aMessage, SessionID aSessionId) {
try

{ setHeader1(aMessage.getHeader(), aSessionId); System.out.println("session existence: "+Session.doesSessionExist(aSessionId)); System.out.println("session lookup: "+Session.lookupSession(aSessionId)); Session.sendToTarget(aMessage, aSessionId); }

catch (SessionNotFound aSessionNotFound)

{ aSessionNotFound.printStackTrace(); }

}

And here is the print out from the two compared, with Fortex first:

session existence: true

session lookup: FIX.4.4:SenderCompID->FTSDEMO_QUOTE.FORTEX.NET[in:2,out:2]

OUTGOING: quickfix.fix43.MarketDataRequest(8=FIX.4.49=15335=V34=249=SenderCompID50=SenderSubID52=20110621-08:57:09.28156=FTSDEMO_QUOTE.FORTEX.NET55=EUR/USD128=146=1262=1263=1264=1265=0267=0269=0460=410=220)

<20110621-08:57:09, FIX.4.4:SenderCompID->FTSDEMO_QUOTE.FORTEX.NET, outgoing> (8=FIX.4.49=15335=V34=249=SenderCompID50=SenderSubID52=20110621-08:57:09.28156=FTSDEMO_QUOTE.FORTEX.NET55=EUR/USD128=146=1262=1263=1264=1265=0267=0269=0460=410=220)

And here's what I get at this same point with Integral:

session existence: false
session lookup: null
quickfix.SessionNotFound
>>> 001
at quickfix.Session.sendToTarget(Session.java:587)
at STXjune17_2011post1$MyApp.send2(STXjune17_2011post1.java:592)
at STXjune17_2011post1$MyApp.getMarketData(STXjune17_2011post1.java:745)
at STXjune17_2011post1.main(STXjune17_2011post1.java:1153)



 Comments   
Comment by Willis Todd [ 21/Jun/11 ]

I probably should also show the code for the later two points referenced at lines 745 and 1153, so here they are. But it seems like the problem is not caused by these things to me, but rather something to do with the first code I shared.

Line 743
public void getMarketData(String symb, int depth){
System.out.println("getMarketData--------");
quickfix.fix43.MarketDataRequest mdr = new quickfix.fix43.MarketDataRequest();
mdr.setField(new DeliverToCompID());
mdr.setField(new Symbol("EUR/USD"));
mdr.setField(new MDReqID(String.valueOf(nextID())));
mdr.setField(new SubscriptionRequestType(SubscriptionRequestType.SNAPSHOT_PLUS_UPDATES));
mdr.setField(new MarketDepth(1));
mdr.setField(new Product(4));
mdr.setField(new NoRelatedSym(1));
mdr.setField(new MDUpdateType(0));
mdr.setField(new MDEntryType(MDEntryType.BID));
mdr.setField(new NoMDEntryTypes());
System.out.println("This is the message :" + mdr.toString());
send2(mdr, mQuoteSessionID);

Line 1153:

app.getMarketData("d", 0);

Comment by Willis Todd [ 24/Jun/11 ]

This problem has been resolved by using different code with Integral. I used the following code and I no longer get SessionNotFound. I hope this helps anyone how has a similar problem!

public void sendMarketRequest() throws SessionNotFound{
quickfix.fix43.MarketDataRequest sub = new quickfix.fix43.MarketDataRequest(new MDReqID("trader79"),new SubscriptionRequestType('1'), new MarketDepth (1));
sub.setField(new Product(4));
sub.setField(new NoRelatedSym(1));
sub.setField(new MDUpdateType(0));
sub.setField(new NoMDEntryTypes(0));
sub.setField(new DeliverToCompID());
sub.setField(new quickfix.field.Symbol("EUR/USD"));
setSecurityType(sub);
try

{ Session.sendToTarget(sub, mOrderSessionID); }

catch(SessionNotFound er)

{ er.printStackTrace(); }

}

Comment by Willis Todd [ 24/Jun/11 ]

I should add that I still have a problem with tags not being sent in the right order, but at least as far as the SessionNotFound problem, that is gone and my message goes out. I'm still trying to find out how to get the tags in the right order.

Generated at Tue Apr 30 18:46:17 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.