Git Product home page Git Product logo

dxfeed-graal-net-api's Issues

No CallBack at all

Hi,

Even if I use the default DXFeed method, my event listener never gets called back. What could be the reason?

var subscription= DXFeed.GetInstance().CreateSubscription(typeof(Quote));
subscription.AddEventListener(events =>
{
    foreach (var e in events)
    {
        Console.WriteLine(e);
    }
});
subscription.AddSymbols("AAPL");

I have a breakpoint inside the Event listener and the breakpoint never gets triggered.

On Server Disconnect, Crash: Fatal error: overwriting existing java.lang.Thread

I'm using the latest 1.1.0 version on .Net 7 and saw a crash that took down my service.

Given the timing (4 minutes after close), I think this happened when the market closed today and the DxLink server disconnected my service. If that's the case, this may have something to do with how the server disconnect is handled in this library.

My service restarted and reconnected 20 seconds later. Is there anything I can do to catch this error?

Here's my AddStateChangeListener, which did get call:

  SP 0x00007f1424dfdde0 IP 0x0DxFeed StateChangeListenerCallback() State: Connecting
internal void StateChangeListenerCallback(State oldState, State newState)
{
	_logger.LogError($"DxFeed StateChangeListenerCallback() State: {newState}");

	if ((newState == State.Connecting || newState == State.Closed || newState == State.NotConnected) 
		&& oldState != newState
		&& oldState != State.NotConnected)
	{
		GetDxFeedEndpoint().ContinueWith(t =>
		{
			_logger.LogError("Unexpected Error", t.Exception);

		}, TaskContinuationOptions.OnlyOnFaulted);
	}
}

internal async Task<DXEndpoint> GetDxFeedEndpoint()
{
	try
	{
		_rwLocker.EnterWriteLock();

		// Force a reconnection with a new token when this is called if it is already connected.
		if (_endpoint != null && !_endpoint.IsClosed())
		{
			_endpoint.Close();
			_endpoint.RemoveStateChangeListener(StateChangeListenerCallback);
			_endpoint.Dispose();
			_subscriptions = null;
		}

		var dxFeedStreamingToken = await _tokensRetriever.RetrieveAuthToken();
		_endpoint = DXEndpoint.Create();
		_endpoint.AddStateChangeListener(StateChangeListenerCallback);

		// Enable experimental feature.
		SystemProperty.SetProperty("dxfeed.experimental.dxlink.enable", "true");
		// Set scheme for dxLink.
		SystemProperty.SetProperty("scheme", "ext:resource:dxlink.xml");

		_endpoint.Connect($"dxlink:{_settings.StreamerUrl!}[login=dxlink:{dxFeedStreamingToken}]");

		_rwLocker.ExitWriteLock();

		return _endpoint;
	}
	catch (Exception)
	{
		if (_rwLocker.IsWriteLockHeld)
		{
			_rwLocker.ExitWriteLock();
		}

		return _endpoint;
	}
}

Here's the log output:

I 240119 230356.589 [oioEventLoopGroup-3-1] DxLinkClientWebSocket-Distributor - Disconnected from wss://my-provider-here.dxfeed.com/realtime
I 240119 230356.589 [oioEventLoopGroup-3-1] DxLinkClientWebSocket-Distributor - Starting DxLinkClientWebSocketConnector to wss://my-provider-here.dxfeed.com/realtime
Fatal error: overwriting existing java.lang.Thread
Current timestamp: 1705705436589
Printing Instructions (ip=0x00007f13f52256d0):
  0x00007f13f52256b0: 0x00 0x41 0xc7 0x87 0xfc 0x00 0x00 0x00 0xfe 0xfe 0xfe 0x7e 0x48 0x8b 0x7c 0x24
  0x00007f13f52256c0: 0x20 0x48 0x8b 0x74 0x24 0x10 0x48 0x8b 0x54 0x24 0x18 0xe8 0x90 0xfc 0xff 0xff
  0x00007f13f52256d0: 0x90 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc 0xcc
  0x00007f13f52256e0: 0x48 0x83 0xec 0x18 0x49 0x3b 0x67 0x08 0x0f 0x86 0x9f 0x00 0x00 0x00 0x48 0x8b
Top of stack (sp=0x00007f1424dfdda0):
  0x00007f1424dfdda0: 0x00007f554b5f8aa8 0xffffffffffffff60
  0x00007f1424dfddb0: 0x00007f13f3307de8 0x00007f13f2b00000
  0x00007f1424dfddc0: 0x00007f13f5275528 0x00007f13f527fb24
  0x00007f1424dfddd0: 0x0000000000000000 0x00007f13f5275528
  0x00007f1424dfdde0: 0x0000000000000000 0xffffffffffffff60
  0x00007f1424dfddf0: 0x00007f13f090da30 0x00007f13f5275417
  0x00007f1424dfde00: 0x0000000000000000 0x00007f13f2b00000
  0x00007f1424dfde10: 0x00007f13f39e1b68 0x00007f13f090da30
  0x00007f1424dfde20: 0x00000000001f5230 0x00007f13f52778f9
  0x00007f1424dfde30: 0x00007f14080c2b80 0x00007f1424dfecdc
  0x00007f1424dfde40: 0x00007f13f090da30 0x00007f13f3c73d38
  0x00007f1424dfde50: 0x000000000000004b 0x00007f13f52569b7
  0x00007f1424dfde60: 0x00007f13f2b00000 0x00000001ffffff60
  0x00007f1424dfde70: 0x000000000000004b 0x00007f13f51d5dcf
  0x00007f1424dfde80: 0x00007f1424dfecdc 0x00007f1400275530
  0x00007f1424dfde90: 0x00007f14001f30d0 0xffffffffffffff58
  0x00007f1424dfdea0: 0x00007f14001f5230 0x0000000000000000
  0x00007f1424dfdeb0: 0x00007f14245fe000 0x00007f13eb0fe600
  0x00007f1424dfdec0: 0x0000000000000000 0xffffffffffffff60
  0x00007f1424dfded0: 0x00007f1424dfecdc 0x00007f554b48f6ba
  0x00007f1424dfdee0: 0x0000000000000000 0x00007f1424dfe6c0
  0x00007f1424dfdef0: 0x00007f554b48f3d0 0x971290752429436f
  0x00007f1424dfdf00: 0xffffffffffffff60 0x0000000000000000
  0x00007f1424dfdf10: 0x00007f13eb0fe600 0x00007f14245fe000
  0x00007f1424dfdf20: 0x693ad9ca99e9436f 0x69b806e4cd09436f
  0x00007f1424dfdf30: 0x0000000000000000 0x0000000000000000
  0x00007f1424dfdf40: 0x0000000000000000 0x0000000000000000
  0x00007f1424dfdf50: 0x0000000000000000 0x92bcb1cb67bbf000
  0x00007f1424dfdf60: 0x00007f554b48f3d0 0x0000000000000000
  0x00007f1424dfdf70: 0xffffffffffffff60 0x00007f554b51e120
  0x00007f1424dfdf80: 0x0000000000000000 0x0000000000000000
  0x00007f1424dfdf90: 0x0000000000000000 0x0000000000000000
Top frame info:
  TotalFrameSize in CodeInfoTable 48

Threads:
  0x00007f140c140040 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "oioEventLoopGroup-12-1" - 0x00007f13eeb018b0, stack(0x00007f13dfb01000,0x00007f13e0300000)
  0x00007f14105de900 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "wss://my-provider-here.dxfeed.com/realtime-Writer" - 0x00007f13eeb019a8, daemon, stack(0x00007f13ed501000,0x00007f13edd00000)
  0x00007f553c16ab00 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "oioEventLoopGroup-10-1" - 0x00007f13eeb01eb0, stack(0x00007f13deaff000,0x00007f13df2fe000)
  0x00007f55401532c0 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "wss://my-provider-here.dxfeed.com/realtime-Writer" - 0x00007f13eeb01fa8, daemon, stack(0x00007f13e34ff000,0x00007f13e3cfe000)
  0x00007f1420182440 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "oioEventLoopGroup-8-1" - 0x00007f13eeb024b0, stack(0x00007f13e3d00000,0x00007f13e44ff000)
  0x00007f1418012900 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "wss://my-provider-here.dxfeed.com/realtime-Writer" - 0x00007f13eeb025a8, daemon, stack(0x00007f13e4cff000,0x00007f13e54fe000)
  0x00007f1420001d40 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "oioEventLoopGroup-6-1" - 0x00007f13eeb02ab0, stack(0x00007f13e20fc000,0x00007f13e28fb000)
  0x00007f1418002300 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "wss://my-provider-here.dxfeed.com/realtime-Writer" - 0x00007f13eeb02ba8, daemon, stack(0x00007f13e28fd000,0x00007f13e30fc000)
  0x00007f13f8003f40 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "oioEventLoopGroup-3-1" - 0x00007f13eeb030b0, stack(0x00007f13ea901000,0x00007f13eb100000)
  0x00007f1400167940 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "DXEndpoint-DXExecutorThread-2" - 0x00007f13eeb03350, daemon, stack(0x00007f13ec901000,0x00007f13ed100000)
  0x0000556364ac5f00 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "DXEndpoint-DXExecutorThread-1" - 0x00007f13eeb035d0, daemon, stack(0x00007f13edf01000,0x00007f13ee700000)
  0x00007f5544001780 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "MonitoringScheduler" - 0x00007f13eeb03750, daemon, stack(0x00007f13ef101000,0x00007f13ef900000)
  0x00007f553c001780 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "CpuMonitor" - 0x00007f13eeb01460, daemon, stack(0x00007f13f0101000,0x00007f13f0900000)
  0x00007f5540000f00 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "TimeSyncTrackerReceiver" - 0x00007f13eeb03b40, daemon, stack(0x00007f13f0f01000,0x00007f13f1700000)
  0x00007f54c4000f40 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "TimeSyncTrackerSender" - 0x00007f13eeb03c68, daemon, stack(0x00007f13fc1ff000,0x00007f13fc9fe000)
  0x00007f54bc000f00 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "clean cache & finalize native" - 0x00007f13eeb03d68, daemon, stack(0x00007f13fd201000,0x00007f13fda00000)
  0x00007f54c0001100 STATUS_IN_NATIVE (ALLOW_SAFEPOINT) "Reference Handler" - 0x00007f13f3a764a8, daemon, stack(0x00007f13fca00000,0x00007f13fd1ff000)
  0x00007f14080c2b80 STATUS_IN_JAVA (PREVENT_VM_FROM_REACHING_SAFEPOINT) "main" - 0x00007f13f3a763f0, stack(0x00007f1424600000,0x00007f1424dff000)

VM thread locals for the failing thread 0x00007f14080c2b80:
  0 (8 bytes): JNIThreadLocalEnvironment.jniFunctions = (bytes)
    0x00007f14080c2b80: 0x00007f13f35c0010
  8 (8 bytes): StackOverflowCheckImpl.stackBoundaryTL = (Word) 1 (0x0000000000000001)
  16 (4 bytes): Safepoint.safepointRequested = (int) 2144413847 (0x7fd12897)
  20 (4 bytes): StatusSupport.statusTL = (int) 1 (0x00000001)
  24 (32 bytes): ThreadLocalAllocation.regularTLAB = (bytes)
    0x00007f14080c2b98: 0x0000000000000000 0x0000000000000000
    0x00007f14080c2ba8: 0x0000000000000000 0x0000000000000000
  56 (8 bytes): PlatformThreads.currentThread = (Object) java.lang.Thread (0x00007f13f3a763f0)
  64 (8 bytes): JavaFrameAnchors.lastAnchor = (Word) 0 (0x0000000000000000)
  72 (8 bytes): AccessControlContextStack = (Object) java.util.ArrayDeque (0x00007f13eeb04660)
  80 (8 bytes): ExceptionUnwind.currentException = (Object) null
  88 (8 bytes): IdentityHashCodeSupport.hashCodeGeneratorTL = (Object) java.util.SplittableRandom (0x00007f13eeb04688)
  96 (8 bytes): IsolatedCompileClient.currentClient = (Object) null
  104 (8 bytes): IsolatedCompileContext.currentContext = (Object) null
  112 (8 bytes): JNIObjectHandles.handles = (Object) com.oracle.svm.core.handles.ThreadLocalHandles (0x00007f13eeb046b0)
  120 (8 bytes): JNIThreadLocalPendingException.pendingException = (Object) null
  128 (8 bytes): JNIThreadLocalPinnedObjects.pinnedObjectsListHead = (Object) null
  136 (8 bytes): JNIThreadOwnedMonitors.ownedMonitors = (Object) null
  144 (8 bytes): NoAllocationVerifier.openVerifiers = (Object) null
  152 (8 bytes): ThreadingSupportImpl.activeTimer = (Object) null
  160 (8 bytes): SubstrateDiagnostics.threadOnlyAttachedForCrashHandler = (bytes)
    0x00007f14080c2c20: 0x0000000000000000
  168 (8 bytes): ThreadLocalAllocation.allocatedBytes = (Word) 19104920 (0x0000000001238498)
  176 (8 bytes): VMThreads.IsolateTL = (Word) 139723652726784 (0x00007f13f2b00000)
  184 (8 bytes): VMThreads.OSThreadHandleTL = (Word) 139724494726848 (0x00007f1424dfe6c0)
  192 (8 bytes): VMThreads.OSThreadIdTL = (Word) 139724494726848 (0x00007f1424dfe6c0)
  200 (8 bytes): VMThreads.StackBase = (Word) 139724494729216 (0x00007f1424dff000)
  208 (8 bytes): VMThreads.StackEnd = (Word) 139724486344704 (0x00007f1424600000)
  216 (8 bytes): VMThreads.StartedByCurrentIsolate = (bytes)
    0x00007f14080c2c58: 0x0000000000000000
  224 (8 bytes): VMThreads.nextTL = (Word) 0 (0x0000000000000000)
  232 (8 bytes): VMThreads.unalignedIsolateThreadMemoryTL = (Word) 139724011088752 (0x00007f14080c2b70)
  240 (4 bytes): ActionOnExitSafepointSupport.actionTL = (int) 0 (0x00000000)
  244 (4 bytes): ActionOnTransitionToJavaSupport.actionTL = (int) 0 (0x00000000)
  248 (4 bytes): ImplicitExceptions.implicitExceptionsAreFatal = (int) 0 (0x00000000)
  252 (4 bytes): StackOverflowCheckImpl.yellowZoneStateTL = (int) 2130640638 (0x7efefefe)
  256 (4 bytes): StatusSupport.safepointBehaviorTL = (int) 1 (0x00000001)
  260 (4 bytes): ThreadingSupportImpl.currentPauseDepth = (int) 0 (0x00000000)

No VMOperation in progress
The 15 most recent VM operation status changes (oldest first):
  1705705434226 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f1420001d40, executingThread: 0x00007f1420001d40, safepointId: 191386)
  1705705434561 - Started Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191387)
  1705705434562 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191387)
  1705705434797 - Started Garbage collection (safepoint: true, queueingThread: 0x00007f1420182440, executingThread: 0x00007f1420182440, safepointId: 191388)
  1705705434798 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f1420182440, executingThread: 0x00007f1420182440, safepointId: 191388)
  1705705435085 - Started Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191389)
  1705705435086 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191389)
  1705705435398 - Started Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191390)
  1705705435399 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191390)
  1705705435716 - Started Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191391)
  1705705435718 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191391)
  1705705436134 - Started Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191392)
  1705705436136 - Finished Garbage collection (safepoint: true, queueingThread: 0x00007f553c001780, executingThread: 0x00007f553c001780, safepointId: 191392)
  1705705436382 - Started Garbage collection (safepoint: true, queueingThread: 0x0000556364b3b400, executingThread: 0x0000556364b3b400, safepointId: 191393)
  1705705436383 - Finished Garbage collection (safepoint: true, queueingThread: 0x0000556364b3b400, executingThread: 0x0000556364b3b400, safepointId: 191393)

Counters:

Java frame anchors for the failing thread 0x00007f14080c2b80:
  No anchors

Stacktrace for the failing thread 0x00007f14080c2b80:
  SP 0x00007f1424dfdda0 IP 0x00007f13f52256d0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shutdown(VMErrorSubstitutions.java:116)
  SP 0x00007f1424dfdda0 IP 0x00007f13f52256d0  [image code] com.oracle.svm.core.jdk.VMErrorSubstitutions.shouldNotReachHere(VMErrorSubstitutions.java:109)
  SP 0x00007f1424dfddd0 IP 0x00007f13f527fb24  [image code] com.oracle.svm.core.util.VMError.shouldNotReachHere(VMError.java:65)
  SP 0x00007f1424dfdde0 IP 0x00007f13f5275528  [image code] com.oracle.svm.core.util.VMError.guarantee(VMError.java:89)
  SP 0x00007f1424dfdde0 IP 0x0DxFeed StateChangeListenerCallback() State: Connecting
0007f13f5275528  [image code] com.oracle.svm.core.thread.PlatformThreads.assignCurrent0(PlatformThreads.java:479)
  SP 0x00007f1424dfde00 IP 0x00007f13f5275417  [image code] com.oracle.svm.core.thread.PlatformThreads.assignCurrent(I 240119 230356.599 [DXEndpoint-DXExecutorThread-1] DxLinkClientWebSocket-Distributor - Stopping DxLinkClientWebSock>PlatformThreads.java:461)
  SP 0x00007f1424dfde30 IP 0x00007f13f52778f9  [image code] com.oracle.svm.core.thread.PlatformThreads.threadStartRoutine(PlatformThreads.java:756)
  SP 0x00007f1424dfde60 IP 0x00007f13f52569b7  [image code] com.oracle.svm.core.posix.thread.PosixPlatformThreads.pthreadStartRoutine(PosixPlatformThreads.java:203)
  SP 0x00007f1424dfde80 IP 0x00007f13f51d5dcf  [image code] com.oracle.svm.core.code.IsolateEnterStub.PosixPlatformThreads_pthreadStartRoutine_cf47bd191b082a3631657d369b9255c828b9a95c(IsolateEnterStub.java:0)

VM mutexes:
  mutex "thread" is unlocked.
  mutex "mainVMOperationControlWorkQueue" is unlocked.
  mutex "referencePendingList" is unlocked.

AOT compiled code is mapped at 0x00007f13f49f0000 - 0x00007f13f6457a0f
Heap settings and statistics:
  Supports isolates: true
  Heap base: 0x00007f13f2b00000
  Object reference size: 8
  Aligned chunk size: 1048576
  Incremental collections: 191393
  Complete collections: 3818

Native image heap boundaries:
  ReadOnly Primitives: 0x00007f13f2c01028 - 0x00007f13f3210c00
  ReadOnly References: 0x00007f13f3210c00 - 0x00007f13f35bf248
  ReadOnly Relocatables: 0x00007f13f35c0000 - 0x00007f13f37f0d80
  Writable Primitives: 0x00007f13f37f1000 - 0x00007f13f3924c10
  Writable References: 0x00007f13f3924c10 - 0x00007f13f3f5ffa0
  Writable Huge: 0x00007f13f4000030 - 0x00007f13f40ad638
  ReadOnly Huge: 0x00007f13f40ae030 - 0x00007f13f4738100
Heap:
  Young generation:
    Eden:
      edenSpace:
        aligned: 1048576/1 unaligned: 0/0
        aligned chunks:
          0x00007f13f0b00000 (0x00007f13f0b01028-0x00007f13f0b011e8)
    Survivors:
      Survivor-1 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-1 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-2 To:
I 240119 230356.600 [DXEndpoint-DXExecutorThread-1] QD - qdnet-8 with collectors [Ticker, Stream, History]
        aligned: 0/0 unaligned: 0/0
      Survivor-3 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-3 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-4 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-5 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-6 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-7 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-8 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-9 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-10 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-11 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-12 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-13 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-14 To:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 From:
        aligned: 0/0 unaligned: 0/0
      Survivor-15 To:
        aligned: 0/0 unaligned: 0/0
  Old generation:
    oldFromSpace:
      aligned: 13631488/13 unaligned: 16908368/5
      aligned chunks:
        0x00007f13eeb00000 (0x00007f13eeb01028-0x00007f13eebfff40)
        0x00007f13e8f00000 (0x00007f13e8f01028-0x00007f13e8ffffd8)
        0x00007f13f1f00000 (0x00007f13f1f01028-0x00007f13f1fffdf8)
        0x00007f13ed300000 (0x00007f13ed301028-0x00007f13ed3ffff8)
        0x00007f13ed100000 (0x00007f13ed101028-0x00007f13ed1ffe48)
        0x00007f13efd00000 (0x00007f13efd01028-0x00007f13efe00000)
        0x00007f13e0d00000 (0x00007f13e0d01028-0x00007f13e0dfff68)
        0x00007f13f1900000 (0x00007f13f1901028-0x00007f13f19ffe10)
        0x00007f13f1700000 (0x00007f13f1701028-0x00007f13f17ffff0)
        0x00007f13f2900000 (0x00007f13f2901028-0x00007f13f29ff8c0)
        0x00007f13f2100000 (0x00007f13f2101028-0x00007f13f21fffc8)
        0x00007f13e9b00000 (0x00007f13e9b01028-0x00007f13e9bfffe8)
        0x00007f13e9700000 (0x00007f13e9701028-0x00007f13e97c6380)
      unaligned chunks:
        0x00007f13e44ff000 (0x00007f13e44ff030-0x00007f13e48ff040)
        0x00007f13e30fc000 (0x00007f13e30fc030-0x00007f13e34fc040)
        0x00007f13e7afe000 (0x00007f13e7afe030-0x00007f13e7efe040)
        0x00007f13ea4fe000 (0x00007f13ea4fe030-0x00007f13ea8fe040)
        0x00007f13fff07000 (0x00007f13fff07030-0x00007f13fff27040)
    oldToSpace:
      aligned: 0/0 unaligned: 0/0

  Unused:
    aligned: 8388608/8
    aligned chunks:
      0x00007f54caa00000 (0x00007f54caa01028-0x00007f54caa01028)
      0x00007f13f1d00000 (0x00007f13f1d01028-0x00007f13f1d01028)
      0x00007f13ea300000 (0x00007f13ea301028-0x00007f13ea301028)
      0x00007f13e9500000 (0x00007f13e9501028-0x00007f13e9501028)
      0x00007f13e7100000 (0x00007f13e7101028-0x00007f13e7101028)
      0x00007f13f2600000 (0x00007f13f2601028-0x00007f13f2601028)
      0x00007f13e9900000 (0x00007f13e9901028-0x00007f13e9901028)
      0x00007f13efb00000 (0x00007f13efb01028-0x00007f13efb01028)
Fatal error: overwriting existing java.lang.Thread
my.service: Main process exited, code=exited, status=99/n/a
my.service: Failed with result 'exit-code'.

Allow Updating the Auth Token Before It Expires

@stdcion As you mentioned here, there's no way to update the token after it has expired without doing a full shutdown and startup:

Is this a feature that can be added? The DxFeed library and connection has been stable, but I have to force a restart every 24 hours just to use a new token for the day.

Thanks!

Current target does not support the CPU features that are required by the image

System: Ubuntu 24.04
IDE: VsCode

I am getting this exception when I run the very first line.

using var endpoint = DXEndpoint.Create().Connect(address);

Exception has occurred: CLR/DxFeed.Graal.Net.Native.ErrorHandling.GraalException
An exception of type 'DxFeed.Graal.Net.Native.ErrorHandling.GraalException' occurred in System.Private.CoreLib.dll but was not handled in user code: 'Current target does not support the CPU features that are required by the image.'
at DxFeed.Graal.Net.Native.ErrorHandling.ErrorCheck.ThrowGraalException(GraalErrorCode errorCode)
at DxFeed.Graal.Net.Native.ErrorHandling.ErrorCheck.SafeCall(GraalErrorCode result)
at DxFeed.Graal.Net.Native.Graal.Isolate.CreateIsolate()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode)
at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue()
at DxFeed.Graal.Net.Native.Graal.Isolate.get_Instance()
at DxFeed.Graal.Net.Native.Graal.IsolateThread.get_CurrentThread()
at DxFeed.Graal.Net.Native.Interop.JavaHandle.get_CurrentThread()
at DxFeed.Graal.Net.Native.Endpoint.BuilderHandle.Create()
at DxFeed.Graal.Net.Native.Endpoint.DXEndpointWrapper.BuilderWrapper..ctor()
at DxFeed.Graal.Net.Api.DXEndpoint.Builder.Build()
at DxFeed.Graal.Net.Api.DXEndpoint.Create(Role role)
at DxFeed.Graal.Net.Api.DXEndpoint.Create()

Any ideas on how to fix it?

Container support

I have built a small .NET worker service that executes every x seconds and pulls some quotes. Running from the development environment works great. When I publish it and try running it from a local docker container, it is failing with the following error. Does the library not support containerization?

Unhandled exception. System.DllNotFoundException: Unable to load shared library 'DxFeedGraalNativeApi' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
/app/DxFeedGraalNativeApi.so: cannot open shared object file: No such file or directory
/app/libDxFeedGraalNativeApi.so: cannot open shared object file: No such file or directory
/app/DxFeedGraalNativeApi: cannot open shared object file: No such file or directory
/app/libDxFeedGraalNativeApi: cannot open shared object file: No such file or directory
at DxFeed.Graal.Net.Native.Graal.Isolate.GraalCreateIsolate(IntPtr param, IntPtr& isolate, IntPtr& isolateThread)
at DxFeed.Graal.Net.Native.Graal.Isolate.CreateIsolate()
at System.Lazy1.ViaFactory(LazyThreadSafetyMode mode) at System.Lazy1.ExecutionAndPublication(LazyHelper executionAndPublication, Boolean useDefaultConstructor)
at System.Lazy1.CreateValue() at DxFeed.Graal.Net.Native.Graal.Isolate.get_Instance() at DxFeed.Graal.Net.Native.Graal.IsolateThread.<>c.<.cctor>b__13_0() at System.Threading.ThreadLocal1.GetValueSlow()
at DxFeed.Graal.Net.Native.Graal.IsolateThread.get_CurrentThread()
at DxFeed.Graal.Net.Native.Graal.Isolate.get_CurrentThread()
at DxFeed.Graal.Net.Native.Endpoint.Handles.BuilderSafeHandle.Create()
at DxFeed.Graal.Net.Native.Endpoint.BuilderNative.Create()
at DxFeed.Graal.Net.Api.DXEndpoint.Builder.Build()
at DxFeed.Graal.Net.Api.DXEndpoint.Create(Role role)
at DxFeed.Graal.Net.Api.DXEndpoint.Create()
at DxFeedService.Workers.TradeWorker.GetNewSubscription()

Authentication without a Port

Hello,

What authentication string would I use for a dxfeed URL in this format:
wss://foo.dxfeed.com/bar
The auth code appears to crash because it is trying to find a Port:
One or more errors occurred. (
Java Class: com.devexperts.qd.qtp.AddressSyntaxException
Java Message: Port number format error in ...

Thanks.

Setting authentication token

I've been digging through the examples and the documentation and I cannot find how to set the authentication token at my brokerage is providing me. How does one go about doing that?

Rate Limit notification

Hello, the below help page:
https://kb.dxfeed.com/en/faq.html
Specifies the rate/data limits:
"The limit on real-time data: the HTTP request header should not exceed 128k for the REST API."

This is fine, but is their any way to pre-emptively see the current request-header size, or any related data. Waiting until API calls start failing isn't ideal.

Thanks.

Support for fromTime on Candles

Hello,
The documentation here (which I assume is for the 'legacy' version) says that the 'fromTime' parameter
https://kb.dxfeed.com/en/data-services/aggregated-data-services/how-to-request-candles.html
may be included as so:
IDxSubscription candleSubscription = con.CreateSubscription(fromTime, new CandleListener());
The graal-net-api version doesn't seem to support a fromTime parameter.

On a related note:
While a simple symbol such as
/ESM23:XCME is supported correctly by graal-net-api, the full symbol specifications as in the link above, such as:
/ESM23:XCME{=15m}
don't seem to work via the graal-net-api
This appears to be the symbol that
https://tools.dxfeed.com/webservice/chart-demo.jsp
is using though.

Thank You.

Version 1.3.0 Error: com.dxfeed.event.candle.CandleSymbol cannot be cast to java.lang.String

@stdcion
Testing out the new 1.3.0 version and getting this error:

SendCandleSubscription() for /ESM24:XCME{=m}{fromTime=20240519-151501.000}
SendCandleSubscription() Error: DxFeed.Graal.Net.Native.ErrorHandling.JavaException: Java exception of type 'java.lang.ClassCastException' was thrown. com.dxfeed.event.candle.CandleSymbol cannot be cast to java.lang.String
        at com.dxfeed.event.market.MarketEventDelegateSet.getTimeSeriesDelegatesByEventSymbol(MarketEventDelegateSet.java:51)
        at com.dxfeed.api.impl.DXFeedImpl.toSubscription(DXFeedImpl.java:541)
        at com.dxfeed.api.impl.DXFeedImpl.access$800(DXFeedImpl.java:63)
        at com.dxfeed.api.impl.DXFeedImpl$SubscriptionChangeListener.symbolsAdded(DXFeedImpl.java:737)
        at com.dxfeed.api.DXFeedSubscription.addSymbolImpl(DXFeedSubscription.java:783)
        at com.dxfeed.api.DXFeedSubscription.addSymbols(DXFeedSubscription.java:507)
        at com.dxfeed.sdk.subscription.SubscriptionNative.dxfg_DXFeedSubscription_addSymbol(SubscriptionNative.java:104)
   at DxFeed.Graal.Net.Native.ErrorHandling.JavaExceptionHandle.ThrowException()
   at DxFeed.Graal.Net.Native.ErrorHandling.JavaExceptionHandle.ThrowIfJavaThreadExceptionExists()
   at DxFeed.Graal.Net.Native.ErrorHandling.ErrorCheck.ThrowIfJavaThreadExceptionExists()
   at DxFeed.Graal.Net.Native.ErrorHandling.ErrorCheck.SafeCall(Int32 result)
   at DxFeed.Graal.Net.Native.Subscription.SubscriptionNative.SubscriptionImport.AddSymbol(IntPtr thread, SubscriptionHandle* subHandle, Object symbol)
   at DxFeed.Graal.Net.Native.Subscription.SubscriptionNative.AddSymbols(Object[] symbols)
   at DxFeed.Graal.Net.Api.DXFeedSubscription.AddSymbols(Object[] symbols)

Has something changed with how Candle subscriptions work?

Best Way to get InstrumentProfile for Schedule.GetInstance(profile)

Trying to use the new Schedule class to get an instruments trading sessions requires passing an InstrumentProfile. I can get an InstrumentProfile from the IPF URL:

However, this data can be HUGE. For one account, it's only 4.6MB. For another, it's 300.9MB. I only need one or two InstrumentProfiles from this data. Using this library, is there another way to get a single InstrumentProfile than loading the full list? I already have a DXEndpoint created and connected to a dxlink URL.

var col = new DxFeed.Graal.Net.Ipf.Live.InstrumentProfileCollector();
var ipf = DxFeed.Graal.Net.Ipf.Live.InstrumentProfileConnection.CreateConnection("https://user:[email protected]/ipf", col);
ipf.Start();
var ipfList = col.View();
foreach (var profile in ipfList)
{
	if (profile.Symbol == "SPY")
	{
		var time = DateTimeOffset.Now.ToUnixTimeMilliseconds();
		var schedule = Schedule.GetInstance(profile);
		schedule.TryGetNearestSessionByTime(time, SessionFilter.REGULAR, out var session);
		var day = schedule.GetDayByTime(time);
		var sessions = day.GetSessions();
		var nextDay = day.GetNextDay(DayFilter.TRADING);
	}
}

Auth without port

My Broker has provided me with the link to connect and it does not have a port.
Its something like wss://abc.dxfeed.com/realtime

How do I authenticate with a token?

Blazor WASM support

When running the example code in a Blazor WASM application, I encounter the following:
image

Is Blazor WASM supported?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.