Isn’t it possible to use Eclipse MicroProfile Metrics with SOAP-based web services on Payara Server 5.193.1? @Counted and @Timed don’t seem to work with @WebService and @WebMethod? Although, @Metric works. Is this by design or is it an issue?
Here is my code:
Interface:
package nl.tent.laboratory.emp.metrics;
import javax.jws.WebMethod;
import javax.jws.WebService;
@WebService
public interface MyWebService {
@WebMethod
String sayHello();
}
Implementation:
package nl.tent.laboratory.emp.metrics;
import javax.jws.WebService;
import org.eclipse.microprofile.metrics.annotation.Counted;
@WebService(endpointInterface = "nl.tent.laboratory.emp.metrics.MyWebService")
public class MyWebServiceImpl implements MyWebService {
// @Inject
// @Metric
// Counter counter;
public MyWebServiceImpl() {
super();
}
@Counted(name = "myCounter")
@Override
public String sayHello() {
// counter.inc();
return "Hello Marc!";
}
}