0

I have gone through similar question. but this seems different where the sessions can connect to different hosts.

My question is if we have one quickfixj server and one quickfixj client running. Can we have multiple sessions between them?

sample FixClient

#session 1 config
SocketConnectPort=8225
SocketConnectHost=127.0.0.1
SenderCompID=Sender
TargetCompID=Target
SessionQualifier=FirstSession
......

#session 2 config
SocketConnectPort=8226
SocketConnectHost=127.0.0.1
SenderCompID=Sender
TargetCompID=Target
SessionQualifier=SecondSession

Is this even possible? I have a case where I need to send two types of messages one is a test message and the other is original. Is there a preferred way to distinguish those messages in application code?

[Updated]

When a fix message coming from an quickfixj application say A, which have two sessions A1, A2. and if I need to send messages to Quickfixj application B(in same process which A is running), which then sends to Quickfixj application C(other process). In application C we need to distinguish messages that are coming from A1 and A2. If I make application B to have two session B1, B2 which connects to C1, C2. then when the message comes from A to route to B's sessions. We need to manually store B1,B2 sessionIDs and route accordingly. So here we just want every message that application B gets will simply pass them to C. with some fix tag then we can differentiate test message.

  • "Can we have multiple sessions between them?" Why don't you assign different Sender/TargetCompIDs? – Christoph John Nov 19 '21 at 23:50
  • Thanks @ChristophJohn , this works. But we have a case where we need to send fix message to different quickfixj applications and each application should have two sessions(one session for original message and one for test message ). And we need to send the message by manually creating sessionId every time. So Is there any field that we can set and use that to distinguish test message from original message? – Vineeth Hanumanthu Nov 22 '21 at 05:36
  • Sorry, I don't understand what you want to achieve. Especially why you need to have same CompIDs for two separate sessions. What do you mean by "we need to send the message by manually creating sessionId every time"? Maybe you can elaborate on that in the question. – Christoph John Nov 22 '21 at 10:42
  • 1
    For routing purposes I'd suggest to use one of the OnBehalfOfCompID or SubID header tags. The SessionQualifier is not sent on the message so you cannot differentiate the messages in C that were sent from either A or B. – Christoph John Nov 22 '21 at 13:29
  • Thanks @ChristophJohn, OnBehalfOfCompID helps. But what is subId and what it's purpose? I have gone through [this](https://www.quickfixj.org/usermanual/2.3.0/usage/configuration.html) but didn't get much info. Can you point me to the detailed documentation on this if any? – Vineeth Hanumanthu Nov 23 '21 at 13:58
  • Here is a very basic description: https://fiximate.fixtrading.org/en/FIX.Latest/cmp1024.html This is the header of the FIX message with different routing tags you could use. – Christoph John Nov 24 '21 at 22:54
  • Hey @ChristophJohn, Thanks for your help. I am able to achieve my task using onbehalfOfCompID. – Vineeth Hanumanthu Dec 23 '21 at 08:23

0 Answers0