Uploaded image for project: 'jBPM'
  1. jBPM
  2. JBPM-9138

RESTWorkItemHandler doesn't support proxy

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Done
    • Icon: Minor Minor
    • 7.39.0.Final
    • 7.36.0.Final
    • Runtime Engine
    • None
    • 2020 Week 22-24 (from May 25)

      It seems that the default rest handler:
      https://github.com/kiegroup/jbpm/blob/master/jbpm-workitems/jbpm-workitems-rest/src/main/java/org/jbpm/process/workitem/rest/RESTWorkItemHandler.java

      does not support proxy.

      Traditionally, JVM usually respects following proxy properties:
      https://stackoverflow.com/questions/120797/how-do-i-set-the-proxy-to-be-used-by-the-jvm
      For example:

      http.proxyHost
      http.proxyPort
      

      Our handler does ignores these.

      The reason is because we are using Apache HttpClient - it has the ability to support these system properties as well, but this ability is DISABLED by default.

      Please see for more detail:

      https://github.com/zzphamvanthanhzz/httpclient-4.5.2-java/blob/master/httpclient/src/main/java/org/apache/http/impl/client/HttpClientBuilder.java#L125

      I am suggesting to add a new RESTWorkItemHandler constructor which accepts boolean flag which would allow to enable these system properties.

      If this boolean flag would be true, then HTTPClient would be built with useSystemProperties(); call

      We have actually tested useSystemProperties() in a real proxy environment, and we have verified that it works as per our expectations, see:

      https://github.com/agiertli/ProxyEnabledRESTWIH/tree/master/src/main/java/org/redhat/services/rest

      We believe that this almost trivial enhancement can bring a lot of value and power which Apache HTTPClient gives you.

      I was also contemplating submitting a PR into community, but didn't figure out how to design a unit test, so I' rather leave it to the core maintaners.

              ftirados Francisco Javier Tirado Sarti
              rhn-support-agiertli Anton Giertli
              Gonzalo Muñoz Fernández Gonzalo Muñoz Fernández
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: