How to use MicroProfile FaultTolerance in Liberty profile [on hold]

39
August 13, 2019, at 9:30 PM

I want to use the circuit break function in MP FaultTolerance feature in my web application. Now I have no idea about how to know if this function has been working in my application. And I want to track the value of MP Metrics added by MP Fault Tolerance automatically as said in https://download.eclipse.org/microprofile/microprofile-fault-tolerance-2.0/microprofile-fault-tolerance-spec.html#fallback

My application runs on WAS Liberty profile 19.0.0.6. I tried to use /metrics to get all Metrics, but only base metrics are returned. The return is as below

# TYPE base:classloader_total_loaded_class_count counter
# HELP base:classloader_total_loaded_class_count Displays the total number of classes that have been loaded since the Java virtual machine has started execution.
base:classloader_total_loaded_class_count 8853

I imported package org.eclipse.microprofile.faulttolerance. Annotation CircuitBreaker into my java code and add annotation in front of a method like this:

@CircuitBreaker(successThreshold = 2, requestVolumeThreshold = 3, failureRatio = 0.5, delay = 1000)
public void handle() throws ApiRequesterException{
    ..........
}

And I added feature in server.xml as below

<featureManager>
     <feature>mpFaultTolerance-1.1</feature>
     <feature>mpMetrics-1.1</feature>
</featureManager>
  1. How can I get the value of Metrics added by Fault Tolerance, such as ft.<name>.circuitbreaker.callsSucceeded.total, ft.<name>.circuitbreaker.callsSucceeded.total and so on.
  2. How can know the annotation CircuitBreaker is working when my application is running?
READ ALSO
Javers SpringBoot integration QueryBuilder byInstanceId returns empty result

Javers SpringBoot integration QueryBuilder byInstanceId returns empty result

I'm using springboot integration from this example:

60
Weird hang which can be resolved by installing JDK

Weird hang which can be resolved by installing JDK

My java application hangs frequentlyThe timing is random

55
JavaFx how to avoid window freezing/not responding when running thread like api [on hold]

JavaFx how to avoid window freezing/not responding when running thread like api [on hold]

When I tried to post to an API which is inside on the thread and run it, the whole window freezes even if I put the thread on the other windowWhat I want is even the thread is running I want to access the window

41
Puppeteer: page.goto(url) keeps loading as about:blank

Puppeteer: page.goto(url) keeps loading as about:blank

I tried to crawl the html using puppeteerBut it failed because the url is fixed as js rendered

52