Skip to content

Commit 6365fdb

Browse files
authored
check super stream creation (#355)
and deletion when the broker is less 3.13.0 Signed-off-by: Gabriele Santomaggio <G.santomaggio@gmail.com>
1 parent d3ecf25 commit 6365fdb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pkg/stream/client.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1037,6 +1037,10 @@ func (c *Client) StreamStats(streamName string) (*StreamStats, error) {
10371037

10381038
func (c *Client) DeclareSuperStream(superStream string, options SuperStreamOptions) error {
10391039

1040+
if !c.availableFeatures.is313OrMore {
1041+
return fmt.Errorf("declaring super stream via client API not supported, server version is less than 3.13.0")
1042+
}
1043+
10401044
if superStream == "" || containsOnlySpaces(superStream) {
10411045
return fmt.Errorf("super Stream Name can't be empty")
10421046
}
@@ -1084,6 +1088,11 @@ func (c *Client) DeclareSuperStream(superStream string, options SuperStreamOptio
10841088
}
10851089

10861090
func (c *Client) DeleteSuperStream(superStream string) error {
1091+
1092+
if !c.availableFeatures.is313OrMore {
1093+
return fmt.Errorf("deleting super stream not supported via client API, server version is less than 3.13.0")
1094+
}
1095+
10871096
length := 2 + 2 + 4 + 2 + len(superStream)
10881097
resp := c.coordinator.NewResponse(commandDeleteSuperStream, superStream)
10891098
correlationId := resp.correlationid

0 commit comments

Comments
 (0)