camel-component-jms
JMS component for rust-camel. Supports ActiveMQ Classic and ActiveMQ Artemis.
URI Format
Three URI schemes are supported:
# Generic — requires explicit destination type
jms:queue:name[?param=value&...]
jms:topic:name[?param=value&...]
# Broker-specific — destination type can be omitted (defaults to queue)
activemq:queue:name[?param=value&...]
activemq:name # shorthand → queue
activemq:topic:name
artemis:queue:name[?param=value&...]
artemis:name # shorthand → queue
artemis:topic:name
Using activemq: or artemis: as scheme locks the broker_type automatically — no brokerType query param needed.
URI Query Parameters
| Parameter | Default | Description |
|---|---|---|
brokerUrl |
tcp://localhost:61616 |
Broker connection URL (overrides Camel.toml) |
username |
— | Broker username (overrides Camel.toml) |
password |
— | Broker password (overrides Camel.toml) |
brokerTypeis not a URI parameter — it is inferred from the scheme (activemq:→ ActiveMQ Classic,artemis:→ Artemis) or set inCamel.toml.
Camel.toml Configuration
[]
= "tcp://localhost:61616"
= "activemq" # "activemq" | "artemis" — ignored when using activemq:/artemis: schemes
= "admin"
= "admin"
Quick Start
use JmsComponent;
// Option A: broker config from Camel.toml
ctx.register_component;
// Option B: programmatic config
use ;
let config = JmsConfig ;
ctx.register_component;
// Option C: broker-specific scheme (locks broker type automatically)
ctx.register_component;
// Consumer — generic scheme
let route = from
.to
.build?;
// Consumer — activemq: shorthand (queue is the default)
let route = from
.to
.build?;
// Producer — override broker URL inline
let route = from
.set_body
.to
.build?;
// Producer — Artemis topic
let route = from
.set_body
.to
.build?;
How It Works
The component manages a Java bridge process (jlink native binary) internally:
- On first use, downloads the bridge binary from GitHub releases (SHA256-verified, cached at
~/.cache/rust-camel/jms-bridge/). - Spawns the bridge with broker config passed via environment variables.
- Reads the ephemeral gRPC port from stdout (
{"status":"ready","port":N}). - Polls the health endpoint until ready, then routes messages over gRPC.
No Java runtime is required on the host — the bridge is a native binary.
Environment Variables
| Variable | Description |
|---|---|
CAMEL_JMS_BRIDGE_BINARY_PATH |
Development override — absolute path to a local jms-bridge binary; skips download entirely |
CAMEL_JMS_BRIDGE_RELEASE_URL |
Override release download URL (must be https://github.com/**) |
Development Setup
Prerequisites
- Docker (daemon running)
- NixOS:
programs.nix-ld.enable = truemust be set in your NixOS configuration - Linux: glibc ≥ 2.34 (Ubuntu 22.04+, Debian 12+, RHEL 9+)
Building the JMS Bridge
The bridge binary is built using Docker (no Java required on your host):
# One-time build (~5–8 min first time, faster on subsequent runs)
# The binary is auto-detected. No env vars needed:
Override
If you need to use a custom binary:
Known Limitations
- IBM MQ not supported (planned for a future release)
- No durable topic subscribers yet