Uploaded image for project: 'JBoss Web Services'
  1. JBoss Web Services
  2. JBWS-4424

Heavy load in CXF Service.getPort calls from a servlet causes performance issue

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Major Major
    • jbossws-cxf-7.2.0.Final
    • jbossws-cxf-7.1.0.Final
    • jbossws-cxf
    • None

      Heavy load in CXF Service.getPort calls from a servlet, will cause performance issue from: 

      https://github.com/apache/cxf/blob/main/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SOAPBindingUtil.java#L92

       

      @WebServlet(
          urlPatterns = {"/WSAccess"},
          asyncSupported = true
      )
      public class WSAccessServlet extends HttpServlet {
          public WSAccessServlet() {
          }
      
          protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
              String endPointAddress = "http://localhost:8080/jaxws-retail/ProfileMgmtService/ProfileMgmt";
              QName serviceName = new QName("http://org.jboss.ws/samples/retail/profile", "ProfileMgmtService");
      
              try {
                  URL wsdlURL = new URL(endPointAddress + "?wsdl");
                  Service service = Service.create(wsdlURL, serviceName);
                  ProfileMgmt proxy = (ProfileMgmt)service.getPort(ProfileMgmt.class);
                  Customer customer = new Customer();
                  customer.setFirstName("Jayé");
                  customer.setLastName("Boss");
                  customer.setCreditCardDetails("newbie");
                  DiscountRequest dRequest = new DiscountRequest();
                  dRequest.setCustomer(customer);
                  DiscountResponse dResponse = proxy.getCustomerDiscount(dRequest);
                  Customer responseCustomer = dResponse.getCustomer();
                  System.out.format("%s %s's discount is %.2f%n", responseCustomer.getFirstName(), responseCustomer.getLastName(), dResponse.getDiscount());
              } catch (Exception var12) {
                  var12.printStackTrace();
              }
      
          }
      } 

       

      The first trying load SOAP relevant class  with current context loader(deployment classloader) always fail. This takes a lot of CPU time and throws other JDK exception  when this is called with high concurrent requests. 

       

              rhn-engineering-ema Jim Ma
              rhn-engineering-ema Jim Ma
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: