Skip to content

Feat/transaction interceptor framework#143

Open
Aamir377300 wants to merge 1 commit into
hiero-ledger:mainfrom
Aamir377300:feat/transaction-interceptor-framework
Open

Feat/transaction interceptor framework#143
Aamir377300 wants to merge 1 commit into
hiero-ledger:mainfrom
Aamir377300:feat/transaction-interceptor-framework

Conversation

@Aamir377300

@Aamir377300 Aamir377300 commented May 6, 2026

Copy link
Copy Markdown
Contributor

This pr resolve issue #141

Description

This PR introduces a TransactionInterceptor framework for the Hiero Enterprise Java SDK to provide a centralized way to handle transaction execution concerns such as retries, logging, and tracing.

While exploring the transaction flow, I noticed that retry handling for temporary failures currently needs to be implemented manually by applications. In scenarios where a node is temporarily BUSY or unavailable for a short time, developers may end up repeating similar retry logic across services.

To improve this, this PR adds a middleware/interceptor-style execution layer around transaction.execute().

Changes Included

  • Added a TransactionInterceptor abstraction

  • Introduced interceptor chain support in ProtocolLayerClientImpl

  • Added ExponentialBackoffRetryInterceptor for handling transient failures such as:

    • BUSY
    • PLATFORM_NOT_ACTIVE
    • temporary network-related issues
  • Added MicroProfile/CDI integration using:

    @Inject Instance<TransactionInterceptor>
    

and kept the design extensible so additional behaviors like metrics, tracing, or auditing can be added easily

Why This Change

This helps provide a shared and reusable resilience layer instead of requiring retry handling in multiple places throughout an application.

It also makes the transaction pipeline more extensible for enterprise use cases.

Verification

Verified successful project build with:

./mvnw clean compile

and tested interceptor registration and execution flow in ProtocolLayerClientImpl

I’d appreciate any feedback or suggestions on the approach and implementation. Thanks for reviewing!

…nism

Signed-off-by: Aamir377300 <belalaamirkhan@gmail.com>
@Aamir377300 Aamir377300 force-pushed the feat/transaction-interceptor-framework branch from 8bb5414 to 3b4513b Compare May 6, 2026 17:00
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