Creates a Record subscription. The subscription is to all fields in the record with no filtering applied.
![](../icons/collapse_all.gif)
C# | Visual Basic | Visual C++ |
IRecordSubscription CreateRecordSubscription( IRecordSubscriptionListener listener, string subject )
Function CreateRecordSubscription ( _ listener As IRecordSubscriptionListener, _ subject As String _ ) As IRecordSubscription
IRecordSubscription^ CreateRecordSubscription( IRecordSubscriptionListener^ listener, String^ subject )
![](../icons/collapse_all.gif)
- listener (IRecordSubscriptionListener)
- The listener that will receive events relating to the subscribed record.
- subject (String)
- A single subject name for the record (for example "/FX/EURUSD").
![](../icons/collapse_all.gif)
A new record subscription.
![](../icons/collapse_all.gif)
![](../icons/CopyCode.gif)
using System; using System.Collections.Generic; using System.Text; using Caplin.StreamLink; using Caplin.StreamLink.Authentication; using Caplin.StreamLink.Subscription.Record; namespace StreamLinkExamples.Record { /// <summary> /// Example of how to create an IRecordSubscription using the /// IStreamLinkProvider interface. /// </summary> public class CreateRecordSubscriptionBasic { /// <summary> /// Creates a simple record subscription with no parameters. /// </summary> public static void CreateRecordSubscriptionBasicExample() { // Set up StreamLink and login credentials StreamLink myStreamLink = new StreamLink(); myStreamLink.CredentialsProvider = new PasswordCredentialsProvider("admin", "admin"); // Set up listener and created the subscription for /DEMO/MSFT IRecordSubscriptionListener listener = new ExampleRecordSubscriptionListener(); IRecordSubscription subscription = myStreamLink.StreamLinkProvider.CreateRecordSubscription(listener, "/DEMO/MSFT"); // Subscribe the subscription, this will be queued until we // login to the Liberator subscription.Subscribe(); // Finally, connect to the Liberator myStreamLink.StreamLinkProvider.Connect(); } } }