我在DolphinDB中创建了一张流表,然后分别在本地节点中订阅和在python api订阅这张流表,本地节点中订阅能收到流数据,但python api订阅端收不到流数据,请问可能是什么原因?我已经把操作系统的防火墙关掉了。
流数据相关配置如下:
maxPubConnections=10
persistenceDir=d:\database\DolphinDB\streamData
subPort=8888
maxSubConnections=10
mode=single
流数据表与本地订阅代码如下:
def createCheckST(){
colnames = [`ts, `minID,`maxID,`err ]
coltypes = [TIMESTAMP, INT, INT, STRING]
st= streamTable(10000:0, colnames, coltypes)
enableTableShareAndPersistence(st,"mtopst", false, true, 1000,100,0);
st1= streamTable(10000:0, colnames, coltypes)
enableTableShareAndPersistence(st1,"ntopst", false, true, 1000,100,0);
}
createCheckST()
subscribeTable(,tableName="ntopst",actionName="node",handler=mtopst,offset=0)
t=table(now() as ts,1 as minid,1 as maxid,"error" as err)
ntopst.append!(t)
python代码如下:
from threading import Event
import dolphindb as ddb
def h(msg):
print(msg)
s=ddb.session()
s.enableStreaming(8888)
s.subscribe("127.0.0.1",8848,h,"ntopst",actionName="python",offset=0,resub=True)
Event().wait()