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 = "/"
 
 


To allow services within your Docker Compose application to resolve external hosts by name, you can use the extra_hosts directive in your docker-compose.yml file. This directive adds entries to the /etc/hosts file within the container, effectively mapping hostnames to IP addresses.
Here is an example of how to configure extra_hosts:
 

version: '3.8'
services:
  my_app:
    image: my_app_image
    extra_hosts:
      - "external-service.example.com:192.168.1.100"
      - "another-host.com:10.0.0.50"
    # Other service configurations...

extra_hosts:
    This key is used within a service definition to specify additional host entries.
    - "hostname:ip_address":

Each entry under extra_hosts should be a string in this format, where hostname is the name you want to use within the container and ip_address is the corresponding IP address of the external host.

To access the Docker host from within a container (for local development):

For Docker Desktop on macOS and Windows, you can use the special DNS name host.docker.internal to resolve to the IP address of the host machine. On Linux, you might need to find the IP address of the docker0 bridge interface or the docker_gwbridge network. 

Example using host.docker.internal (Docker Desktop):
 

version: '3.8'
services:
  my_app:
    image: my_app_image
    extra_hosts:
      - "host.docker.internal:host-gateway" # Recommended for Docker Desktop
    # Other service configurations...

Note: The host-gateway keyword is a convenient way for Docker Desktop to automatically resolve host.docker.internal to the correct host IP.
After making changes to your docker-compose.yml file, remember to restart your services using docker-compose up -d for the changes to take effect.

Source: Google AI