【发布时间】:2019-10-31 10:00:11
【问题描述】:
我想从 DolphinDB 订阅数据,我已经在 DolphinDB 中运行了这些代码:
share streamTable(10000:0,`time`sym`price`id, [TIMESTAMP,SYMBOL,DOUBLE,INT]) as trades
setStreamTableFilterColumn(trades, `sym)
insert into trades values(take(now(), 10), rand(`ab`cd`ef`gh`ij, 10), rand(1000,10)/10.0, 1..10)
以及 Python 中的这些代码:
import dolphindb as ddb
import numpy as np
s = ddb.session()
s.enableStreaming(8000)
def handler(lst):
print(lst)
s.subscribe("localhost",8848,handler,"trades","action",0,False,np.array(['ab']))
我遇到了这个错误:
ERROR in subscribeInternal err: The feature of publish is not enabled.
Retry subscribe in 1 second
ERROR in subscribeInternal err: The feature of publish is not enabled.
Retry subscribe in 1 second
ERROR in subscribeInternal err: The feature of publish is not enabled.
Retry subscribe in 1 second
那么如何开启发布功能呢?
【问题讨论】:
标签: python database api streaming dolphindb