Skip to content

Commit

Permalink
fixing some issues with BankClient
Browse files Browse the repository at this point in the history
  • Loading branch information
eya-cherif committed Dec 29, 2024
1 parent e18198d commit 363537a
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions payment/src/main/java/payment/api/clients/BankClient.java
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
package payment.api.clients;



import java.util.UUID;

import org.eclipse.microprofile.faulttolerance.Retry;
import org.eclipse.microprofile.rest.client.annotation.ClientHeaderParam;
import org.eclipse.microprofile.rest.client.inject.RegisterRestClient;

import jakarta.enterprise.context.ApplicationScoped;
import jakarta.transaction.Transactional;
import jakarta.ws.rs.Consumes;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.POST;
Expand All @@ -21,15 +18,16 @@
@Path("/payments")
@Produces(MediaType.APPLICATION_JSON)
@Consumes(MediaType.APPLICATION_JSON)
@RegisterRestClient(baseUri = "http://localhost:8099/")
@RegisterRestClient
public interface BankClient {

@POST
@Transactional
@Retry(maxRetries = 3, delay = 500, jitter = 200)

@Retry(maxRetries = 3, delay = 500, jitter = 200)
@ClientHeaderParam(name = "X-API-Key", value = "${bank.api.key}")
Response makeNewPayment(BankPaymentRequest bankPaymentRequest);

@GET
@Path("/{id}")
@ClientHeaderParam(name = "X-API-Key", value = "${bank.api.key}")
Response paymentById(@PathParam("id") UUID paymentId);
}
}

0 comments on commit 363537a

Please sign in to comment.