Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default value for schema.repository.deleteSchemaPathSuffix is problematic #1569

Open
SpOOnman opened this issue Oct 7, 2022 · 2 comments
Open
Assignees

Comments

@SpOOnman
Copy link

SpOOnman commented Oct 7, 2022

Default value for schema.repository.deleteSchemaPathSuffix is versions. This is problematic when you use Confluent's Schema Registry. Path that is built for removing a subject is not compliant with Schema Registry's API:

"DELETE /subjects/pierwsza.testowy/versions HTTP/1.1" 405

There are two issues:

  • this request returns Method not allowed, because it's only specified for GET
  • there is no such path for deletion.

According to Confluent's docs you can delete subjects only with two allowed paths:

  • DELETE /subjects/(string: subject)
  • DELETE /subjects/(string: subject)/versions/(versionId: version)

I think it would be great to set schema.repository.deleteSchemaPathSuffix's default value to empty string. This way default Hermes Management configuration would comply to Confluent's Schema Registry API.

Additional minor issue is that on Hermes' documentation page default value for this property is not properly formatted. It renders in wrong column.

Steps to reproduce

  1. Download hermes project and enable topic deletion with schema deletion for Hermes management in docker-compose.yml:

       management:
         image: allegro/hermes-management
         ports:
           - "8090:8090"
         depends_on:
           - zk
           - kafka
           - graphite
         environment:
           TOPIC_ALLOW_REMOVAL: "true"
           TOPIC_REMOVE_SCHEMA: "true"
    
  2. Use docker-compose up.

  3. Open Hermes console and add new group pierwsza and new topic testowy with any AVRO schema

  4. Try do delete a topic - this gives an error:

    • Error 400 Bad schema request for subject pierwsza.testowy, server response: 405 {"error_code":405,"message":"HTTP 405 Method Not Allowed"}

How to fix

Set schema.repository.deleteSchemaPathSuffix to empty:

        environment:
          TOPIC_ALLOW_REMOVAL: "true"
          TOPIC_REMOVE_SCHEMA: "true"
          SCHEMA_REPOSITORY_DELETE_SCHEMA_PATH_SUFFIX: ""

Recommended change

Change schema.repository.deleteSchemaPathSuffix default value to ''.

@adriansobolewski
Copy link
Contributor

adriansobolewski commented Oct 17, 2023

Hey, I would like to tackle this issue on Hacktoberfest :)

@szczygiel-m
Copy link
Contributor

Hi, nice to hear that! Assigned 😄

adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
…aPathSuffix to empty string. This has been done to make requests to default Confluent schema registry match its delete url.
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
…aPathSuffix to empty string. This has been done to make requests to default Confluent schema registry match its delete url.
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
…des methods to read and modify the schema. Modified RawSchemaClient to provide only read methods.
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
…aPathSuffix to empty string. This has been done to make requests to default Confluent schema registry match its delete url.
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
…des methods to read and modify the schema. Modified RawSchemaClient to provide only read methods.
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
adriansobolewski added a commit to adriansobolewski/hermes that referenced this issue Oct 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants