Jump to content
We've recently updated our Privacy Statement, available here. ×

Using a Dynamic Variable within TREP-RT Subscribing Input Adapter Settings

Mehmed Aktas

Recommended Posts

Hi, I want to use a Dynamic Variable for the Username field of theTREP-RT Subscribing Input Adapter. However, I see that tha adapter process my dynamic variable as a plain string value. I see that the Username field could process a parameter but not a dynamic variable. How could I use a dynamic variable for the Username field
Link to comment
Share on other sites

Hello mehmed.aktas,

I do not believe it is possible to use a dynamic variable in the Username property of the TREP-RT Subscribing Input Adapter for TIBCO Streaming/StreamBase.


If you say more about why you want to change usernames during a given run of the StreamBase server/engine process and also tell us what version of StreamBase you are using, perhaps we can think of some other approaches to the problem you are trying to solve.

Link to comment
Share on other sites

Thanks for the response.


I need to get the unique username within a FIX message in each FIX session I establish. If dynamic variable does not work, I may use TREP as a module reference in my FIX application. First, I will get the username from FIX connection and send it as an input to TREP module to run it. What do you think

Link to comment
Share on other sites

What you are trying to do can be done, but I don't know that I love it. Also, how feasible it is will depend on the number of unique usernames you expect for a single StreamBase server process. If it is more than, say, a handful of dozens or even low hundreds at the outside, I would not even try it.

Because the username for TREP-RT here is an adapter property, that property has to be set before the adapter instance is initialized. Adapter instances are initialized only when a StreamBase container starts up. Trying to do this using a module reference and module parameters is not going to work for values that are only known after the container is initialized, which is going to be true if your FIX username is coming across a FIX connection.


So what you would need to do is an StreamBaseAdminClient.addContainer operation to create a new container and load your TREP-RT-specific code into it, setting some top-level module parameters for the container such, well, username, etc. You would create inter-container connections (ICCs) into and out of the per-user TREP-RT containers either using statically defined ICCs, the StreamBaseClient adapters, or some other communications method of your choice.


Also, you would probably want some logic to remove each per-user container when the FIX session terminates.


This kind of dynamic and automated container management I've seen StreamBase users do maybe a half a dozen times over the past 15 years, and it's not something to necessarily expect to take on in an afternoon's work.


If your user base is larger, then you might end up wanting to start up multiple StreamBase engines and making remote intercontainer connections or better using some message bus between the server instances. Now you are in the business of managing your own StreamBase cluster, which is a bit of work to do with StreamBase 7 and perhaps the primary reason why StreamBase 10 was invented.


Also, the other reason why I asked which version of StreamBase you are using is that in StreamBase 10+, adding containers dynamically might not be the preferred way to go. The StreamBase 10+ world is tending toward adding new StreamBase engines for scaling and having that managed in OCI/Docker containers and Kubernetes and that's a whole different story. Not that you couldn't do the StreamBase container thing in StreamBase 10 but the direction of the platform is sort of heading away from it, and you'd be swimming upstream on a number of issues.


But for StreamBase 7, yeah, addContainer may be your only option here.


What might I do instead Good question. TR is notably concerned with making sure each user is licensed properly and that no one is using something like StreamBase to in effect be a service bureau that violates the TR licensing terms. It sounds like you are going about it the right way by doing things per-user and we aren't making it easy for you with the adapter property model. This might be a good discussion to have with Streaming Product Management (Manish Patel, manpatel@tibco.com) in order to make the TREP-RT adapters more dynamically-oriented, if that's even technically feasible.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...