Advanced features

Here you can find details on how to access some of the more advanced XRebel functionality.


XRebel Standalone UI

XRebel’s toolbar injection does not apply to Web Services, because these applications do not have any actual web page contents (into which we would usually inject the XRebel toolbar). The same applies to applications that do not allow injecting the XRebel toolbar. There is a workaround for this.

  1. Open a new browser window.
  2. Enter your application URL and add /xrebel at the end of it.
  3. The XRebel standalone UI is displayed.
../_images/standaloneui.png

You can now use the XRebel profiler functionality, with data polled from your Web Services applications. Enjoy!


XRebel with single page applications and AJAX

XRebel can be used with applications where frontend and backend are served by separate instances. These applications require more configuration for injecting the XRebel toolbar.

To inject the XRebel toolbar into a single page application, add the following code snippet to the HTML source before closing the <body> tag:

<script>
window.XREBEL_SERVERS = ["http://backend1.mycompany:1337/MyApplication"];

  (function() {
    var script = document.createElement("script");
    script.src = window.XREBEL_SERVERS[0] + "/a65f4bf22bdd793dca6963ffe7fa0c62/resources/init.min.js";
    document.body.appendChild(script);
  }());
</script>

Note

window.XREBEL_SERVERS is a plain JavaScript array. You can specify multiple Java backends by separating the URLs with a comma:

window.XREBEL_SERVERS = ["URL1", "URL2"]

Warning

Do not forget to remove the XRebel toolbar injection code when moving to a production environment!


XRebel ignore lists

XRebel allows excluding specified classes from tracing instrumentation (application profiling). You can manually ignore classes by listing them as regular expressions in ~/.xrebel/traces-blacklist.txt.

XRebel excludes static and transient fields when calculating the size of an object. You can also manually ignore classes and packages by listing them in the file ~/.xrebel/session-blacklist.txt.


XRebel launch parameters

The following advanced XRebel launch parameters can be used for further configuration:

  • -Dxrebel.single_app_mode=true|false (default value: true) – Consider all deployments to be part of a single application. This reports activity from different deployment units to one and the same toolbar.
  • -Dxrebel.injection.log_response=true|false (default: false) – When true, the content of HTTP servlet responses will be logged to xrebel.log. This is meant to help debug cases when XRebel toolbar is not properly injected into the application’s HTML.
  • -Dxrebel.session.include_transient_fields=true|false (default value: false) – When true, fields with the transient modifier will be considered when constructing the session graph. By default, all transient fields are ignored and objects reachable only through transient fields are not considered to be part of the session.
  • -Dxrebel.browser.console_log=true|false (default value: false) – When true, the client side XRebel log will be written into the browser console.
  • -Dxrebel.injection=true|false (default value: true) – Disables the XRebel toolbar injection into application HTML. Add /xrebel to your application URL to view the toolbar in a separate tab (this opens the alternative UI view).
  • -Dxrebel.traces.filter_resources=true|false (default value: true) – Prevents displaying resource requests in the Application profiling view.
  • -Dxrebel.include_all_io=true|false (default value: true) – Enables the display of all detected IO events. IO events that cannot be categorized are displayed as Unidentified.
  • -Dxrebel.sql.format=true|false (default value: true) – Enables formatting of SQL queries.
  • -Dxrebel.traces.all=true|false (default value: false) – Enables tracing for all contexts.
    • -Dxrebel.traces.jms=true|false (default value: false) – Enables tracing for JMS.
    • -Dxrebel.traces.scheduler=true|false (default value: false) – Enables tracing for ScheduledExecutorService.
    • -Dxrebel.traces.quartz=true|false (default value: false) – Enables tracing for Quartz.
    • -Dxrebel.traces.rabbitmq=true|false (default value: false) – Enables tracing for RabbitMQ.

Individual module integration parameters

All individual integrations for modules can be disabled at will. The following advanced XRebel launch parameters can be used:

  • -Dxrebel.module.http.HttpURLConnection=true|false (default value: true) – Disables collecting IQ queries from java.net.HttpURLConnection usage.
  • -Dxrebel.module.http.HttpCore=true|false (default value: true) – Disables collecting IO queries from Apache HttpCore 4.x usage.
  • -Dxrebel.module.http.HttpClient3=true|false (default value: true) – Disables collecting IO queries from Apache HttpClient 3.x usage.
  • -Dxrebel.module.mongodb=true|false (default value: true) – Disables collecting IO queries from MongoDB driver usage.
  • -Dxrebel.module.hbase=true|false (default value: true) – Disables collecting IO queries from HBase driver usage.
  • -Dxrebel.module.redis=true|false (default value: true) – Disables collecting IO queries from Redis driver usage.
  • -Dxrebel.module.cassandra=true|false (default value: true) – Disables collecting IO queries from Cassandra driver usage.
  • -Dxrebel.module.orm=true|false (default value: true) – Disables collecting information about ORM queries, including Hibernate JPA queries.
  • -Dxrebel.module.equinox=true|false (default value: true) – Disables support for Equinox class loaders (boot delegation).
  • -Dxrebel.module.rmi=true|false (default value: true) – Disables collecting IO queries from RMI (java.rmi) remote object invocations.
  • -Dxrebel.module.traces=true|false (default value: true) – Enables the application profiling view.
  • -Dxrebel.module.session=true|false (default value: true) – Disables taking session snapshots.
  • -Dxrebel.module.springloaded=true|false (default value: true) – Disables Spring Loaded agent when detected.
  • -Dxrebel.module.async=true|false (default value: true) – Disables collecting IO queries from asynchronously executed threads.
  • -Dxrebel.module.quartz=true|false (default value: true) – Disables collecting IO queries within a Quartz job context.
  • -Dxrebel.module.jms=true|false (default value: true) – Disables collecting IO queries within JMS MessageListener.onMessage() context.
  • -Dxrebel.module.scheduler=true|false (default value: true) – Disables collecting IO queries for ScheduledThreadPoolExecutor tasks.
  • -Dxrebel.module.rabbitmq=true|false (default value: true) – Disables collecting IO events within RabbitMQ consumer.handleDelivery() context and outgoing messages.
  • -Dxrebel.module.remote_events=true|false (default value: true) – Disables collecting and displaying data from remote XRebel-enabled web services (microservices).
  • -Dxrebel.module.jdbc=true|false (default value: true) – Disable collecting IO queries from JDBC usage.
    • -Dxrebel.module.jdbc.sql=true|false (default value: true) – Disables collecting IO queries from relational database JDBC usage. Requires -Dxrebel.module.jdbc to be true.
    • -Dxrebel.module.jdbc.neo4j=true|false (default value: true) – Disables collecting IO queries from Neo4j JDBC usage. Requires -Dxrebel.module.jdbc to be true.
    • -Dxrebel.module.jdbc.cassandra=true|false (default value: true) – Disables collecting IO queries from Cassandra JDBC usage. Requires -Dxrebel.module.jdbc to be true.
    • -Dxrebel.module.jdbc.phoenix=true|false (default value: true) – Disables collecting IO queries from Apache Phoenix (HBase) usage. Requires -Dxrebel.module.jdbc to be true.

Debugging with XRebel enabled

When XRebel is enabled, it could prove difficult to step into XRebel methods. To resolve this issue, configure your IDEs to enable step filtering for com.zeroturnaound.xrebel.*.


Step filtering with Eclipse

  1. Open Preferences > Java > Debug > Step Filtering.
  2. Enable Use Step Filters.
  3. Add a filter for com.zeroturnaround.xrebel.* and java.*.

Step filtering with IntelliJ IDEA

  1. Open Settings > Build, Execution, Deployment > Debugger > Stepping.
  2. Enable Do not step into the classes.
  3. Add a filter for com.zeroturnaround.xrebel.*.

Microservices

XRebel can profile distributed applications or microservices. To do this, an XRebel agent needs to run with every separate application in the microservices structure. All agents have to be activated using a valid license. The XRebel Agents communicate using HTTP. The collected profiling data is collected and displayed in the profiling view within the front-end (web) application.

../_images/microservices.png

Transactions marked with the remoteicon icon originate from microservice applications running with XRebel enabled. For more information about using XRebel, please refer to the using XRebel chapter.