[英]flink cep sql Event Not triggering
我在 Flink SQL 中使用 CEP 模式,它按預期連接到 Kafka 代理。 但是當我連接到基於集群的雲 kafka 設置時,Flink CEP 沒有觸發。 這是我的sql:
create table agent_action_detail
(
agent_id String,
room_id String,
create_time Bigint,
call_type String,
application_id String,
connect_time Bigint,
row_time TIMESTAMP_LTZ(3), WATERMARK for row_time as row_time - INTERVAL '1' MINUTE)
with ('connector'='kafka', 'topic'='agent-action-detail', ...)
然后我以json格式發送消息,例如
{"agent_id":"agent_221","room_id":"room1","create_time":1635206828877,"call_type":"inbound","application_id":"app1","connect_time":1635206501735,"row_time":"2021-10-25 16:07:09.019Z"}
在 flink web ui 中,水印工作正常flink web ui
我運行我的 cep sql :
select * from agent_action_detail
match_recognize(
partition by agent_id
order by row_time
measures
last(BF.create_time) as create_time,
first(AF.connect_time) as connect_time
one row per match AFTER MATCH SKIP PAST LAST ROW
pattern (BF+ AF) define BF as BF.connect_time > 0 ,AF as AF.connect_time > 0
)
每個 kafka 消息,connect_time > 0,但 flink 沒有觸發。 有人可以幫助解決這個問題,在此先感謝!
這看起來像一個沒有退出條件的循環模式。 這種模式不允許清除模式匹配引擎的內部狀態。
如果您直接使用 Flink CEP,我會告訴您嘗試添加until(condition)
或within(time)
來限制可能匹配的數量。
使用MATCH_RECOGNIZE
,看看您是否可以向模式添加不同的終止元素。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.