Skip to content

Commit

Permalink
Add error log when new jetty client (apache#12840)
Browse files Browse the repository at this point in the history
  • Loading branch information
shoothzj authored and eolivelli committed Nov 29, 2021
1 parent 98cd1ee commit d293e45
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@ protected HttpClient newHttpClient() {

if (config.isTlsEnabledWithBroker()) {
try {
X509Certificate trustCertificates[] = SecurityUtility
X509Certificate[] trustCertificates = SecurityUtility
.loadCertificatesFromPemFile(config.getBrokerClientTrustCertsFilePath());

SSLContext sslCtx;
Expand All @@ -281,6 +281,7 @@ protected HttpClient newHttpClient() {

return new JettyHttpClient(contextFactory);
} catch (Exception e) {
LOG.error("new jetty http client exception ", e);
try {
auth.close();
} catch (IOException ioe) {
Expand All @@ -303,7 +304,7 @@ protected String rewriteTarget(HttpServletRequest request) {

boolean isFunctionsRestRequest = false;
String requestUri = request.getRequestURI();
for (String routePrefix: functionRoutes) {
for (String routePrefix : functionRoutes) {
if (requestUri.startsWith(routePrefix)) {
isFunctionsRestRequest = true;
break;
Expand All @@ -324,7 +325,7 @@ protected String rewriteTarget(HttpServletRequest request) {

if (LOG.isDebugEnabled()) {
LOG.debug("[{}:{}] Selected active broker is {}", request.getRemoteAddr(), request.getRemotePort(),
url.toString());
url);
}
} catch (Exception e) {
LOG.warn("[{}:{}] Failed to get next active broker {}", request.getRemoteAddr(),
Expand Down

0 comments on commit d293e45

Please sign in to comment.