JMS Bridge Configuration
The JMS Bridge is configured using a HOCON file, which allows for flexible and structured configuration. This guide provides an overview of the configuration options available for the JMS Bridge.
All configuration for the JMS Bridge is provided via a file passed to the jms-bridge-server-start
script.
📁 An example configuration can be found at:
JMS_BRIDGE_ROOT/etc/jms-bridge/jms-bridge.conf
The configuration is written using Lightbend’s config library and the HOCON format.
🔗 Learn more about HOCON
Simple Configuration (jms-jms)
Section titled “Simple Configuration (jms-jms)”The following is a simple configuration for the JMS Bridge, which connects to a Kafka cluster and uses default settings for message types and topics.
bridge { id = quick-start-basic
kafka { bootstrap.servers = "<kafka-host>:<kafka-port>" }
journals { topic { replication = 1 } }}
Configuration Breakdown
Section titled “Configuration Breakdown”bridge: Root configuration block for the JMS Bridge service.
- id: Unique identifier for the bridge instance. It is used to name topics and can support multiple bridges per cluster.
- kafka: Configuration settings for the Kafka connection.
- journals: Configuration settings for the journal topics.
- topic: Settings for the journal topic, such as replication factor and partitioning.
kafka: Configuration settings for the Kafka connection.
-
Kafka Running Locally or on a VM
- Use this configuration when Kafka is running locally or on a VM
- Replace
<kafka-host>:<kafka-port>
with your Kafka broker’s address- localhost:9092 (if Kafka is running locally)
- 192.168.1.10:9092 (if Kafka is running on a VM)
-
Kafka in Confluent Cloud
-
If you are using Confluent Cloud, you need to provide additional security parameters in the configuration file.
-
Replace
<kafka-host>:<kafka-port>
with your Confluent Cloud Kafka cluster address. -
Add the following security parameters to the
kafka
block:kafka {bootstrap.servers = "<kafka-host>:<kafka-port>"security.protocol = SASL_SSLsasl.jaas.config = org.apache.kafka.common.security.plain.PlainLoginModule requiredusername="<your_username>"password="<your_password>";sasl.mechanism = PLAIN}
-
Complete Configuration (kafka-jms)
Section titled “Complete Configuration (kafka-jms)”The following is a complete configuration for the JMS Bridge, which includes advanced settings such as routing, security, and Kafka Streams state directory.
bridge { id = quick-start-kafka-integration
kafka { bootstrap.servers = "<kafka-host>:<kafka-port>" }
streams { state.dir = "/<path-to>/kafka-streams" }
journals { topic { replication = 1 } } security { domain = "MyDomain" } routing = { metadata.refresh.ms=60000 topics = [ { match = ".*ab.*" message.type = "TEXT" }, { match = ".*psy.*" message.type = "TEXT" } ] }}
Configuration Breakdown
Section titled “Configuration Breakdown”bridge: Root configuration block for the JMS Bridge service.
- id: Unique identifier for the bridge instance. It is used to name topics and can support multiple bridges per cluster.
- kafka: Configuration settings for the Kafka connection.
- bootstrap.servers: Address of the Kafka broker(s) to connect to.
- streams: Configuration settings for Kafka Streams.
- state.dir: Local directory where Kafka Streams stores its internal state. Defaults to
/tmp/kafka-streams
if unspecified.
- state.dir: Local directory where Kafka Streams stores its internal state. Defaults to
- journals: Configuration settings for the journal topics.
- topic: Settings for the journal topic, such as replication factor and partitioning.
- security: Security settings for the JMS Bridge.
- domain: Specifies the JAAS login context name defined in your
login.config
.
- domain: Specifies the JAAS login context name defined in your
- routing: Routing configuration defines how JMS addresses are mapped to Kafka topics.
- metadata.refresh.ms: Time interval (in ms) to synchronize topic mappings. Default is
50000 ms
if unspecified. - topics: List of topic routing rules.
- match: Regular expression to match JMS addresses. For example,
".*ab.*"
matches any topic containing “ab” anywhere in the name. - message.type: Specifies the message format used for matched topics (e.g.,
TEXT
orBYTES
).
- match: Regular expression to match JMS addresses. For example,
- metadata.refresh.ms: Time interval (in ms) to synchronize topic mappings. Default is