RepoPilot

How do their APIs compare?

About netflix/hystrix · 2 messages · last activity 8/15/2026

Question

How do their APIs compare?

RepoPilot

Comparing "APIs" across these two projects is a bit apples-to-oranges since they serve very different purposes, but here's how they line up based on what's in the retrieved data:

netflix/hystrix — a runtime resilience library API

Hystrix exposes APIs meant to be called at application runtime to wrap and protect calls to remote/risky dependencies:

  • Annotation-based API (hystrix-javanica module): developers annotate methods with @HystrixCommand (and @CacheRemove) rather than writing explicit command classes. This is enabled via AspectJ weaving, configured either through aop.xml referencing com.netflix.hystrix.contrib.javanica.aop.aspectj.HystrixCommandAspect, or via Spring AOP/Spring Java config registering HystrixCommandAspect as a bean [hystrix-contrib/hystrix-javanica/README.md:L19-L38]. There's also a HystrixCacheAspect for cache-eviction annotations used outside of commands [hystrix-contrib/hystrix-javanica/README.md:L595-L606].
  • Clojure API (hystrix-clj): wraps a plain function using defcommand, turning it into a Hystrix-protected command that can be invoked synchronously or queued for async execution via queue [hystrix-contrib/hystrix-clj/README.md:L35-L60].
  • Metrics/streaming HTTP APIs (hystrix-metrics-event-stream-jaxrs): JAX-RS resource classes expose REST-style endpoints for monitoring, e.g. HystrixRequestEventsSseController at path /hystrix/request.stream [hystrix-contrib/hystrix-metrics-event-stream-jaxrs/.../HystrixRequestEventsSseController.java:L36-L50] and HystrixConfigSseController at /hystrix/config.stream, which streams config via HystrixConfigurationStream/SerialHystrixConfiguration [hystrix-contrib/hystrix-metrics-event-stream-jaxrs/.../HystrixConfigSseController.java:L29-L49]. These build on a shared AbstractHystrixStreamController base [hystrix-contrib/hystrix-metrics-event-stream-jaxrs/.../AbstractHystrixStreamController.java:L15-L36].

So Hystrix's "API surface" is oriented around command execution and observability — annotate/wrap a call, then optionally scrape its state over HTTP/SSE streams.

pxb1988/dex2jar — a compiler-IR-style library API

dex2jar's retrieved code is all from the dex-ir module, which models an intermediate representation (IR) for translating Dalvik bytecode toward JVM bytecode. Its API is a data-structure / transformation API, not a runtime service API:

  • Core IR types: IrMethod, Trap (exception handler ranges tied to LabelStmt) [dex-ir/.../ir/Trap.java:L16-L24], StmtList (a statement list with LabelAndLocalMapper support) [dex-ir/.../ir/stmt/StmtList.java:L16-L28], and Stmts factory helpers [dex-ir/.../ir/stmt/Stmts.java:L16-L18].
  • Expression types modeling invocations: InvokeExpr for interface/special/virtual/static/new invocations [dex-ir/.../ir/expr/InvokeExpr.java:L16-L35], AbstractInvokeExpr as a shared base [dex-ir/.../ir/expr/AbstractInvokeExpr.java:L16-L19], InvokeCustomExpr for invokedynamic-style call sites using CallSite/Proto [dex-ir/.../ir/expr/InvokeCustomExpr.java:L16-L19], and an Exprs factory that builds expressions using CallSite, DexType, Method, MethodHandle, Proto [dex-ir/.../ir/expr/Exprs.java:L16-L22].
  • Transformation API: an abstract Transformer class that operates over an IrMethod [dex-ir/.../ir/ts/Transformer.java:L16-L19] — this is the extension point for IR optimization/simplification passes.

So dex2jar's API

Want to ask your own question?

Open chat for netflix/hystrix

Public Q&A. Generated by RepoPilot from the actual source of netflix/hystrix. AI answers can be incomplete or stale — verify before relying on them.