You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Client.Namespaces().SetTopicAutoCreation() allows setting a TopicAutoCreation allowed policy on the namespace with default topic type non-partitioned.
Actual behavior
SetTopicAutoCreation has a parameter utils.TopicAutoCreationConfig, this struct has an int field Partitions (defaultNumPartitions) which cannot be nil. When trying to SetTopicAutoCreation with config (Allow=true,Type="non-partitioned",Partitions=0) the API call will fail with:
{"reason":"Invalid configuration for autoTopicCreationOverride. the detail is [defaultNumPartitions] is not allowed to be set when the type is non-partition."}
This happens with any value for Partitions. In the pulsar admin rest-api the defaultNumPartitions field is optional, it should either be made optional as well in TopicAutoCreationConfig or the library should not include the field when Type="non-partitioned".
With the rest API I can do: curl --data '{"allowAutoTopicCreation":true,"topicType":"non-partitioned"}' --header "Content-Type: application/json" --header "Accept: application/json" $APIHOST/admin/v2/namespaces/$tenant/$namespace/autoTopicCreation
Steps to reproduce
Call Client.Namespaces().SetTopicAutoCreation() with a TopicAutoCreation with Allow=true and Type="non-partitioned"
System configuration
Pulsar version: 2.11.2
The text was updated successfully, but these errors were encountered:
…ned (#1107)
Fixes#1105
### Motivation
To allow setting the AutoTopicCreation policy to non-partitioned it is required to not send the partitions parameter, by making Partitions a pointer instead of an int this is possible.
### Modifications
Change the type of Partitions in TopicAutoCreationConfig from int to *int
Expected behavior
Client.Namespaces().SetTopicAutoCreation() allows setting a TopicAutoCreation allowed policy on the namespace with default topic type non-partitioned.
Actual behavior
SetTopicAutoCreation has a parameter utils.TopicAutoCreationConfig, this struct has an int field Partitions (defaultNumPartitions) which cannot be nil. When trying to SetTopicAutoCreation with config (Allow=true,Type="non-partitioned",Partitions=0) the API call will fail with:
{"reason":"Invalid configuration for autoTopicCreationOverride. the detail is [defaultNumPartitions] is not allowed to be set when the type is non-partition."}
This happens with any value for Partitions. In the pulsar admin rest-api the defaultNumPartitions field is optional, it should either be made optional as well in TopicAutoCreationConfig or the library should not include the field when Type="non-partitioned".
With the rest API I can do:
curl --data '{"allowAutoTopicCreation":true,"topicType":"non-partitioned"}' --header "Content-Type: application/json" --header "Accept: application/json" $APIHOST/admin/v2/namespaces/$tenant/$namespace/autoTopicCreation
Steps to reproduce
Call Client.Namespaces().SetTopicAutoCreation() with a TopicAutoCreation with Allow=true and Type="non-partitioned"
System configuration
Pulsar version: 2.11.2
The text was updated successfully, but these errors were encountered: