NatsClient AggReceived never fires
See original GitHub issueI’ve recently set up the Nats client in my application and found that AggReceived
never fires while TradeReceived
and QuoteReceived
fire continuoulsy as expected.
Here is a console application that illustrates the problem. AlpacaNatsTest.zip
And code for good measure:
class Program
{
public static void Main(string[] args)
=> new Program().MainAsync().GetAwaiter().GetResult();
public async Task MainAsync()
{
var _natsClient = new NatsClient("API_KEY", false);
_natsClient.Open();
_natsClient.OnError += OnNatsClientError;
_natsClient.AggReceived += OnBarReceived;
_natsClient.TradeReceived += OnTradeReceived;
_natsClient.QuoteReceived += OnQuoteReceived;
_natsClient.SubscribeTrade("NFLX");
_natsClient.SubscribeQuote("NFLX");
_natsClient.SubscribeMinuteAgg("NFLX");
System.Console.ReadLine();
_natsClient.Close();
}
private void OnQuoteReceived(IStreamQuote obj)
{
System.Diagnostics.Debug.WriteLine($"Quote {obj.AskPrice}");
}
private void OnTradeReceived(IStreamTrade obj)
{
System.Diagnostics.Debug.WriteLine($"Trade {obj.Price}");
}
private void OnBarReceived(IStreamAgg obj)
{
System.Diagnostics.Debug.WriteLine($"Bar {obj.Close}"); // NEVER fires
}
private void OnNatsClientError(string obj)
{
System.Diagnostics.Debug.WriteLine(obj);
}
}
Using Alpaca.Markets 2.1.2 SDK
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Buffering Messages During Reconnect Attempts - NATS Docs
The Core NATS client libraries try as much as possible to be fire and ... it is possible that it is never sent...
Read more >National Grid 20-F 2020 Redacted Combined Document
This constitutes the annual report on Form 20-F of National Grid plc (the “Company”) in accordance with the requirements of the US Securities...
Read more >Annual Report and Accounts 2019/20
The job that can't wait. We believe that people are the key to unlocking a clean energy future, and we ran a recruitment...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@codebeaulieu Will run build and publish new version on NuGet later this evening. Thank you for your support!
looks good @OlegRa