Skip to content

Add HTTP Method configuration for target endpoint (POST/PUT) - #307

Open
joshiausdemwald wants to merge 7 commits into
Aiven-Open:mainfrom
joshiausdemwald:add_http_method_configuration
Open

joshiausdemwald wants to merge 7 commits into
Aiven-Open:mainfrom
joshiausdemwald:add_http_method_configuration

Conversation

@joshiausdemwald

Copy link
Copy Markdown

Summary

Picks up #198 (by @ecararus), rebased onto current main and updated to address the review feedback from @jeqo:

  • Simplify HttpMethodsType to a plain enum (drop the redundant name field and forName), following the OAuth2AuthorizationMode pattern.
  • Build the HttpRequest once in AbstractHttpSender.prepareRequest and switch only on the method, instead of duplicating the builder call per method.
  • Rename requestBuilder to request in send().
  • Assert HTTP methods in DefaultHttpSenderTest against plain string literals instead of the enum, so a rename doesn't silently pass.

Adds a http.method sink config option (default POST, supports POST/PUT) used when sending data to the target endpoint.

Closes #198.

Test plan

  • ./gradlew compileJava compileTestJava
  • ./gradlew checkstyleMain checkstyleTest clean for all files this PR touches
  • ./gradlew test --tests "io.aiven.kafka.connect.http.sender.*" --tests "io.aiven.kafka.connect.http.config.*" passing

Eugeniu and others added 5 commits July 30, 2026 20:32
… endpoint, Defaulted on POST Method. Supported POST/PUT
Fix linter reported issue
Fix Linter reported issue
Fix Linter reported issue
- Simplify HttpMethodsType to a plain enum (drop the redundant
  name field and forName lookup), following the OAuth2AuthorizationMode
  pattern
- Build the HttpRequest once in AbstractHttpSender.prepareRequest and
  switch only on the method, removing the duplicated builder calls
- Rename requestBuilder to request in send() and drop a stray comment
- Assert HTTP methods in DefaultHttpSenderTest against plain string
  literals instead of the enum, so a rename doesn't silently pass
MR Author added 2 commits July 30, 2026 20:45
Fix import order (org.apache.kafka before io.aiven), align indentation
with the file's existing style, and drop a leftover times(1) call whose
static import had been removed upstream.
Extend HttpMethodsType with PATCH and build the request via the
generic HttpRequest.Builder#method since java.net.http has no
dedicated PATCH builder method.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants