apisix icon indicating copy to clipboard operation
apisix copied to clipboard

feat: APISIX Stream Route Enable Disable Plugin

Open amandewatnitrr opened this issue 8 months ago • 4 comments

Description

A stream-level plugin that acts as a runtime on/off switch for stream routes.

Operators often need to temporarily disable a stream route during maintenance windows, incident response, or gradual rollouts — without deleting the route from the configuration. This plugin provides that capability by gating TCP/TLS connections at the preread phase: when enabled is true, traffic passes through normally; when false, inbound connections are rejected with a configurable message before the socket is closed.

amandewatnitrr avatar Mar 30 '26 17:03 amandewatnitrr

I opened this issue, and currently raised a MR #13130 regarding the same. Waiting for review, consideration and approval.

amandewatnitrr avatar Mar 30 '26 17:03 amandewatnitrr

Hi @amandewatnitrr, regarding this issue, could we implement a similar status field for stream routes, similar to the HTTP route's status field? This approach would align with existing HTTP route behavior, reduce the cognitive load on users, and skip the route matching phase, eliminating the need to establish a connection before rejecting the route.

Baoyuantop avatar Mar 31 '26 08:03 Baoyuantop

Hi @Baoyuantop,

Sure, actually we can do that. I was working on something personal, and had to develop this plugin to solve this issue, to see clear logs. But, yes this is definitely a better solution.

amandewatnitrr avatar Mar 31 '26 16:03 amandewatnitrr

Could you adjust the technical aspects of your PR?

Baoyuantop avatar Apr 01 '26 03:04 Baoyuantop