[QFJ-114] variables in config-file Created: 25/Nov/06  Updated: 19/Sep/08  Resolved: 09/Jan/07

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

Type: Other Priority: Default
Reporter: Welf Wustlich Assignee: Steve Bate
Resolution: Fixed Votes: 0
Labels: None
Environment:

linux, netbeans



 Description   

We are using QFJ within a group and we'd like to use in our config-file an environment variable:
FileStorePath=$HOME/devel/log/fh_test
unfortunately $HOME does not work.

Also we'd like to configure other variables in the session section in our business application like
userID and passwd in the session sections.
How can we do this and how do I get access from my business-application?

Thank you, Welf



 Comments   
Comment by Steve Bate [ 09/Jan/07 ]

The SessionSettings class supports variable interpolation using a configured set of substitution values. By default, the substitution values are JVM system properties. However, you can use setVariableValues() to configure your own set of substitution values. Of course, these in turn can be loaded from a property file and the approach can support simple property inheritance by constructing a chain of java.util.Properties objects (see the Properties constructor options).

The variable syntax is $

{variable}

. For example FileStorePath=logs/$

{user.name}

would substitute the user name into the path using the "user.name" system property as the substitution value.

Comment by Parag Mehta [ 28/Jun/07 ]

Interpolation in 1.1.0 does not work with SenderCompID in default section, though it works elsewhere. Steve, any suggestions?

Thanks.

Generated at Sat Nov 23 11:12:59 UTC 2024 using JIRA 7.5.2#75007-sha1:9f5725bb824792b3230a5d8716f0c13e296a3cae.