InterSystems' Kafka component is Java-based. You need to tune the Java (Java Gateway) used by your service.

For Java 8, here are some widely recommended JVM parameters and best practices, particularly focusing on memory management and Garbage Collection (GC):

1. Heap Size Configuration

This is the most fundamental step.

Fixed Heap Size: Set the initial and maximum heap sizes to the same value to prevent the JVM from resizing the heap dynamically during runtime. This reduces GC overhead and improves application stability.

        -Xms<size>: Initial Java heap size.

        -Xmx<size>: Maximum Java heap size.

        Example: -Xms4G -Xmx4G (sets initial and max heap to 4 Gigabytes)

Sizing: The value should be determined by monitoring your application's memory usage under load. A good rule of thumb is to set -Xmx to about 75-80% of the available physical RAM to leave room for the Operating System and JVM overhead (Metaspace, thread stacks, etc.).

2. Garbage Collector (GC) Selection

In Java 8, the default GC is the Parallel Collector (for server-class machines), which focuses on high throughput (less time spent in GC overall, but potentially longer pause times).

For most modern applications, especially those requiring lower latency, the G1 (Garbage-First) Collector is generally recommended starting from Java 7/8.

Use G1 Collector:

        -XX:+UseG1GC

The sample and the article not used this: 

Set setting = ##class(%External.Messaging.RabbitMQSettings).%New()

Set tClient = ##class(%External.Messaging.Client).CreateClient(setting, .tSC)

If you use only the ObjectScript code to connect Rabbit, you must set some properties into your setting variable:

 set setting = ##class(%External.Messaging.RabbitMQSettings).%New()
 set setting.host = "localhost"
 set setting.port = 5672
 set setting.username = "guest"
 set setting.password = "guest"
 set setting.virtualHost = "/"