API Support Forum
OEC API > FIX Support > Problems establishing FAST connection
Author Topic: Problems establishing FAST connection
(3 messages, Page 1 of 1)
Moderators: VPfau
JStanford4318
Posts: 3
Joined:


Posted: Nov 25, 2014 @ 09:30 PM             Msg. 1 of 3
Hi,

I'm just starting out on a project to connect to the FAST server. I have successfully connected to the FIX server and received a FAST key. I appear to be successfully negotiating the Hello messages. When I try to send a Logon message, I appear to be getting an incoming "Template not supported message".

I'm using OpenFAST, and my debug output looks like this:


[INFO] [11/25/2014 18:03:09.148] [FixFastSystem-akka.actor.default-dispatcher-2] [akka://FixFastSystem/user/fixAppActor/fastConsumer] Starting FastConsumerActor
[INFO] [11/25/2014 18:03:09.159] [FixFastSystem-akka.actor.default-dispatcher-2] [akka://FixFastSystem/user/fixAppActor/fastConsumer] Available FAST template count = 47
[DEBUG] [11/25/2014 18:03:09.427] [FixFastSystem-akka.actor.default-dispatcher-2] [akka://FixFastSystem/user/fixAppActor/fastConsumer] using 20141126020309 for datetime
[DEBUG] [11/25/2014 18:03:09.428] [FixFastSystem-akka.actor.default-dispatcher-2] [akka://FixFastSystem/user/fixAppActor/fastConsumer] sending message = Logon -> {null, A, 20141126020309, 30, JStanford4318, 7F59B2EA51D71DC02ACD25C536F3405D4473BF4635C32888CB934CF02C3C0BDF6EAE580F68B10333C1E55A99631F77C18CA1EF58FE82FEDF810BE7843874374C154B7B70F4B61CAC92F3D9B6C60829FFEADEDC5EBCC3DE5A1E209C62760B9DCD9D5AC3198153E624D4380D42E61C9FBC623982FFEBC4B592185D38CDF8A3AE70}
[DEBUG] [11/25/2014 18:03:09.428] [FixFastSystem-akka.actor.default-dispatcher-2] [akka://FixFastSystem/user/fixAppActor/fastConsumer] sent logon message
[INFO] [11/25/2014 18:03:09.428] [FixFastSystem-akka.actor.default-dispatcher-2] [akka://FixFastSystem/user/fixAppActor/fastConsumer] Finished connecting FastConsumerActor
Exception in thread "FAST Session Message Reader" org.openfast.error.FastException: Template not supported

[INFO] [11/25/2014 18:03:09.494] [FAST Session Message Reader] [akka://FixFastSystem/user/fixAppActor/fastConsumer] IN: Alert -> {16003, 2, 11, null, Template not supported}


As I was posting this, I realized that the logon message had null in the 0th field (I think that's the templateId), so I tried it again with that set to 63, and got the same response. Here's that message:


sending message = Logon -> {63, A, 20141126022208, 30, JStanford4318, 83E61BBC....}


I'm not sure if there is anything unusual about how I'm establishing the connection and sending messages, so here's the related chunk of code:


log.info("Starting FastConsumerActor")
val oecTemplateInputStream = getClass.getResourceAsStream("oec_templates.xml")
val scpTemplateInputStream = getClass.getResourceAsStream("scpTemplates-1.1.xml")
val templateLoader = new XMLMessageTemplateLoader()
templateLoader.load(oecTemplateInputStream)
templateLoader.load(scpTemplateInputStream)
oecTemplateInputStream.close()
scpTemplateInputStream.close()
val templateRegistry = templateLoader.getTemplateRegistry

log.info("Available FAST template count = {}", templateRegistry.getTemplates.length)

val host = context.system.settings.config.getString("akka.fast.host")
val port = context.system.settings.config.getInt("akka.fast.port")
val user = context.system.settings.config.getString("akka.fast.user")
val endpoint = new TcpEndpoint(host, port)
val client = new FastClient("oecFastClient", SessionConstants.SCP_1_1, endpoint)
client.setInboundTemplateRegistry(templateRegistry)
client.setOutboundTemplateRegistry(templateRegistry)
client.setMessageHandler(new FastMessageListener())
val session = client.connect()
session.setListening(true)
session.in.addMessageHandler(new MessageHandler {
override def handleMessage(readMessage: Message, context: Context, coder: Coder): Unit = {
log.info("IN: " + readMessage.toString)
}
})

val message = new Message(templateRegistry.get("Logon"))
val now = DateTime.now(DateTimeZone.UTC).toString(DateTimeFormat.forPattern("YYYYMMddhhmmss"))
log.debug("using {} for datetime", now)
// message.setInteger(0, 63)
message.setLong("SendingTime", now.toLong)
message.setString("Username", user)
message.setString("Password", key)
log.debug("sending message = {}", message.toString)
session.out.writeMessage(message, true)
log.debug("sent logon message")


The in message handler was a hack so I could log the incoming message.

Any help sorting this out is greatly appreciated!

Thanks,
John

John Stanford
JStanford4318
Posts: 3
Joined:


Posted: Nov 26, 2014 @ 11:45 PM             Msg. 2 of 3
Slight improvement in the situation I think. I now get a Logout message from the FAST server in response to my Login. The reason provided is "SoftwareNotPermitted". Any pointers are greatly appreciated!


The change to get that response was setting the template IDs from AuxIDs:


val templateLoader = new XMLMessageTemplateLoader()
templateLoader.setLoadTemplateIdFromAuxId(true)


Message exchange:


[DEBUG] [11/26/2014 20:41:48.658] [FixFastSystem-akka.actor.default-dispatcher-3] [akka://FixFastSystem/user/fixAppActor/fastConsumer] sending message = Logon -> {null, A, 20141127044148, 30, JStanford4318, 420C76420ABBBB24B3F418032E773041661D11C09B4850BE70F2A8E3DECA785668F8042AC16B57CA5AA152555D1253ADADBB427065521280F4A88637E77FADDB692B8C6AC9F57549A851B180D0D6E7F525B9A319385A3F08A9B971F7EB42009B2675375D0F59576FC8D73CA74E4542F779D30572253E6E38E6B1DBA3DABC3E95}
[DEBUG] [11/26/2014 20:41:48.658] [FixFastSystem-akka.actor.default-dispatcher-3] [akka://FixFastSystem/user/fixAppActor/fastConsumer] sent logon message
[INFO] [11/26/2014 20:41:48.658] [FixFastSystem-akka.actor.default-dispatcher-3] [akka://FixFastSystem/user/fixAppActor/fastConsumer] Finished connecting FastConsumerActor
[INFO] [11/26/2014 20:41:48.727] [FAST Session Message Reader] [akka://FixFastSystem/user/fixAppActor/fastConsumer] IN: Logout -> {61, 5, 20141127044148, SoftwareNotPermitted}
2545 [FAST Session Message Reader] INFO FastMessageListener - IN: Logout -> {61, 5, 20141127044148, SoftwareNotPermitted}


I am thankful for any guidance.

Best regards,
John

John Stanford
JStanford4318
Posts: 3
Joined:


Posted: Nov 29, 2014 @ 12:41 PM             Msg. 3 of 3
Resolved. I needed to include the UUID in the FIX login message.

John Stanford