JMS Bridge Configuration
All configuration for the JMS Bridge is provided via a jms-bridge.conf
file that is passed to the jms-bridge-server-start
script.
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. Used in topic naming.
- kafka:
- bootstrap.servers: Address of the Kafka broker(s) to connect to. (e.g.,
localhost:9092
oryour-kafka-host:9092
)
- bootstrap.servers: Address of the Kafka broker(s) to connect to. (e.g.,
- journals:
- topic.replication: Replication factor for journal topics.
Kafka Deployment Notes:
-
Local or VM Kafka: Replace
<kafka-host>:<kafka-port>
with your local/VM Kafka broker address. -
Confluent Cloud: If 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 configuration 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 = ".*invoice.*" message.type = "TEXT" }, { match = ".*payment.*" 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. Used in topic naming.
- kafka:
- bootstrap.servers: Address of the Kafka broker(s) to connect to.
- streams:
- state.dir: Local directory where Kafka Streams stores its internal state. Defaults to
/tmp/kafka-streams
.
- state.dir: Local directory where Kafka Streams stores its internal state. Defaults to
- journals:
- topic.replication: Replication factor for journal topics.
- security:
- domain: JAAS login context name defined in your
login.config
.
- domain: JAAS login context name defined in your
- routing: Defines how JMS addresses are mapped to Kafka topics.
- metadata.refresh.ms: Time interval to synchronize topic mappings. Default is
50000 ms
. - topics:
- match: Regex to match JMS addresses (e.g.,
.*invoice.*
). - message.type: Message format (
TEXT
orBYTES
).
- match: Regex to match JMS addresses (e.g.,
- metadata.refresh.ms: Time interval to synchronize topic mappings. Default is