jiazhai commented on a change in pull request #4157:
[Issue#2734][pulsar-brokers]Add namespace level enforcement on schema validation
URL: https://github.com/apache/pulsar/pull/4157#discussion_r279238198
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/admin/v2/Namespaces.java
##########
@@ -843,5 +843,37 @@ public void
setSchemaAutoUpdateCompatibilityStrategy(@PathParam("tenant") String
internalSetSchemaAutoUpdateCompatibilityStrategy(strategy);
}
+ @GET
+ @Path("/{tenant}/{namespace}/schemaValidationEnforced")
+ @ApiOperation(value = "Get schema validation enforced flag for namespace.
If the flag is set to true, when "
+ + " a producer without a schema attempts to
produce to a topic with schema in this"
+ + " the namespace, the producer will be failed to
connect. PLEASE be carefully on"
+ + " using this, since non-java clients don't
support schema.if you enable this setting,"
+ + " it will cause non-java clients failed to
produce.")
+ @ApiResponses(value = { @ApiResponse(code = 403, message = "Don't have
admin permission"),
+ @ApiResponse(code = 404, message = "Tenants or
Namespace doesn't exist") })
+ public boolean getSchemaValidtionEnforced(@PathParam("tenant") String
tenant,
+ @PathParam("namespace") String
namespace) {
+ validateNamespaceName(tenant, namespace);
+ return internalGetSchemaValidationEnforced();
+ }
+
+ @POST
+ @Path("/{tenant}/{namespace}/schemaValidationEnforced")
+ @ApiOperation(value = "Set schema validation enforced flag on namespace.
If the flag is set to true, when"
+ + " a producer without a schema attempts to
produce to a topic with schema in this the"
Review comment:
same here "this the"
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services