How to enable JMX for underlying Jetty in Camel Salesforce ?

Solution Verified - Updated -

Issue

  • We're using Camel Salesforce 2.17.0.redhat-630343 in stand-alone Java 1.8 springboot application which fetches various objects from Salesforce cloud (Contacts, Teams, Accounts). This works fine but generates intermittent errors like the one below. Since Camel Salesforce uses Jetty 9 for http requests, we want to enable JMX metrics for Jetty HttpClient and track response times between our application and Salesforce.
  • We are not sure how to enable JMX for Jetty HttpClient in Camel Salesforce.
  • TIMEOUT ERROR
07-23-18 15:19:54 ERROR   (A-route) [org.apache.camel.util.CamelLogger]: ############## Exception : {message:'Unexpected error {0:null} executing {GET:https://IP:PORT/services/data/v37.0/sobjects/Contact/23456789}',statusCode:0}
    at org.apache.camel.component.salesforce.internal.client.AbstractClientBase$1.onComplete(AbstractClientBase.java:142)
    at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:193)
    at org.eclipse.jetty.client.ResponseNotifier.notifyComplete(ResponseNotifier.java:185)
    at org.eclipse.jetty.client.HttpReceiver.terminateResponse(HttpReceiver.java:454)
    at org.eclipse.jetty.client.HttpReceiver.abort(HttpReceiver.java:535)
    at org.eclipse.jetty.client.HttpChannel.abortResponse(HttpChannel.java:129)
    at org.eclipse.jetty.client.HttpChannel.abort(HttpChannel.java:122)
    at org.eclipse.jetty.client.HttpExchange.abort(HttpExchange.java:257)
    at org.eclipse.jetty.client.HttpConversation.abort(HttpConversation.java:141)
    at org.eclipse.jetty.client.HttpRequest.abort(HttpRequest.java:704)
    at org.eclipse.jetty.client.TimeoutCompleteListener.run(TimeoutCompleteListener.java:71)
    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
    at java.util.concurrent.FutureTask.run(FutureTask.java:266)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
    at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
    at java.lang.Thread.run(Thread.java:745)
Caused by: java.util.concurrent.TimeoutException: Total timeout elapsed
    ... 8 more

Environment

  • Red Hat JBoss Fuse
    • Spring Boot(Camel version 2.17.0.redhat-630343)

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content