Skip to content

Migrate from legacy com.ning async-http-client to org.asynchttpclient#453

Merged
jaredstehler merged 1 commit into
masterfrom
js-use-ahc-3
Jun 3, 2026
Merged

Migrate from legacy com.ning async-http-client to org.asynchttpclient#453
jaredstehler merged 1 commit into
masterfrom
js-use-ahc-3

Conversation

@jaredstehler

Copy link
Copy Markdown
Contributor

Why

The multipart request builder depended on com.ning:async-http-client (1.9.x),
which has been EOL/unmaintained for years — upstream development moved to
org.asynchttpclient:async-http-client long ago. Keeping the Ning artifact pins
a stale, unsupported HTTP/Netty stack on the classpath and blocks dependency and
security updates that flow through basepom.

What

  • Root pom: bumped basepom 68.1 → 69.3 and horizon 0.5.3 → 0.5.4, which
    brings in dependency management for the maintained org.asynchttpclient
    artifact and a consistent Netty version.
  • slack-java-client pom: replaced com.ning:async-http-client with
    org.asynchttpclient:async-http-client, and declared io.netty:netty-buffer
    and io.netty:netty-codec-http directly since the new multipart API surfaces
    Netty types (ByteBuf, HttpHeaders) the builder now uses.
  • MultipartHttpRequest: rewritten against the new API. Parts moved from
    com.ning.http.client.multipart.* to
    org.asynchttpclient.request.body.multipart.*. Part.setFileName(...) no
    longer exists, so file names are passed via the ByteArrayPart/FilePart
    constructors. Body bytes are produced by draining a
    MultipartUtils.newMultipartBody(...) MultipartBody into a ByteBuf.
  • Removed TerminatingMultipartRequestEntity: it existed only to append the
    trailing MIME end-boundary that the old JDK provider omitted. The new
    MultipartUtils.generateMultipartParts already appends a
    MessageEndMultipartPart, making the workaround obsolete.

Notes

  • The new FilePart constructor eagerly validates that the file exists and is
    readable (throws IllegalArgumentException), so a bad path now fails at
    build() time rather than at write time.
  • The ...http.ning package name was left unchanged to avoid rippling import
    changes through SlackWebClient.

mvn clean verify passes across all modules.

🤖 Generated with Claude Code

The multipart request builder depended on com.ning:async-http-client (1.9.x),
which has been EOL/unmaintained for years -- upstream development moved to
org.asynchttpclient long ago. Keeping the Ning artifact pins a stale,
unsupported HTTP/Netty stack on the classpath and blocks dependency and
security updates that flow through basepom. Bumping basepom to 69.3 makes the
maintained artifact (and a consistent Netty) available, so the multipart body
construction is moved over to it and the obsolete end-boundary workaround is
dropped (the new MultipartUtils already appends the message-end part).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jaredstehler jaredstehler merged commit c429606 into master Jun 3, 2026
2 checks passed
@jaredstehler jaredstehler deleted the js-use-ahc-3 branch June 3, 2026 12:58
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.

1 participant