当前位置:Gxlcms > 数据库问题 > nanomsg 如何写数据到PipelineDB

nanomsg 如何写数据到PipelineDB

时间:2021-07-01 10:21:17 帮助过:32人阅读

# create extension nanomsgtopdb ; CREATE EXTENSION

 

 默认数据接收流

pipeline=# \d generic_stream
         Stream "public.generic_stream"
      Column       |            Type
-------------------+-----------------------------
 data              | text
 arrival_timestamp | timestamp(0) with time zone

pipeline=#

 

创建Continuous View

pipeline=# create continuous view cv as select data from generic_stream;
CREATE CONTINUOUS VIEW
pipeline=# \d cv
Continuous view "public.cv"
 Column | Type | Modifiers
--------+------+-----------
 data   | text |

pipeline=#

 

发送数据:

[root@localhost test]# ./send_msg
connect to tcp://127.0.0.1:9999
Send msg size is 64

pipeline=# select * from cv;
 data
------
(0 rows)

pipeline=# select * from cv;
           data
--------------------------
 Hello ,from nanomsg msg.
(1 row)

pipeline=#

 

运用PostgreSQL来创建后台进程,如图所示:

技术分享

 

多nanomsg worker process进行数据写入,提高数据接收速度。

 

运用场景:

在底层数据采集的时候,原始数据直接写入到Stream生成CV结果。

 

nanomsg 如何写数据到PipelineDB

标签:nanomsg   code   roc   bsp   generic   str   rri   tin   tcp   

人气教程排行