Adapter: JMS (AMQP 1.0)
Send to a JMS queue or topic on ActiveMQ, Artemis, IBM MQ or another AMQP 1.0 broker; the JMS Listener trigger reads from one.
Purpose
Put messages on a JMS queue or topic, and (with the JMS Listener trigger) consume them. It is the counterpart of Mirth's JMS Sender and JMS Listener, and the Mirth importer maps both to it.
MedHook talks to the broker over AMQP 1.0, not the Java JMS API, so there is no JNDI or connection factory to set up. A send step waits until the broker accepts the message: rejected fails the step without a retry, released or no answer within timeout is retried by the step's error handling. A text step input is sent as a JMS TextMessage, a Buffer as a BytesMessage, anything else as JSON text with application/json.
Brokers
| Broker | brokerType | Notes |
|---|---|---|
| ActiveMQ Classic 5.x | activemq | Enable the AMQP transport connector (amqp://0.0.0.0:5672, or amqp+ssl on 5671). Queues and topics are addressed queue://name and topic://name. |
| ActiveMQ Artemis | artemis | The amqp acceptor is on by default. The name is the address; a queue or topic capability picks anycast or multicast routing. |
| IBM MQ 9.2 and later | generic | Define and start an AMQP channel (DEFINE CHANNEL(MEDHOOK) CHLTYPE(AMQP) PORT(5672), then START CHANNEL(MEDHOOK)) and set SSLCIPH on it for TLS. MQ maps an AMQP address to a topic string; for a queue, route it to the queue with the channel's settings or a topic alias. Check the mapping with your MQ administrator. |
| Qpid, Solace, Azure Service Bus | generic | AMQP 1.0 natively; use the queue or topic name as the address. |
Auth
- SASL PLAIN with
usernameandpassword; SASL ANONYMOUS when no user is set. - TLS with
tlsEnabled: a private CA (tlsCaPem, replacing or adding to the system store), a minimum version (tlsMinVersion, TLS 1.2 by default), mutual TLS with a client certificate, andtlsServernamewhen the certificate's name differs fromhost. Certificate verification is never turned off. - Plain AMQP is accepted, as Mirth accepts it, but saving, validating or testing such a profile returns a warning (a stronger one with a password), because the password and every message travel in clear text. Use TLS for PHI.
Settings
Auth is no selector; the secret settings below are the credentials. Dotted names are fields inside an object setting. Secret settings are encrypted at rest, never returned by a read, and shown masked in the console and in exports; their defaults are not shown.
| Setting | Type | Required | Default | Secret | Description |
|---|---|---|---|---|---|
host | string | Yes | No | Broker host name or IP address. | |
port | number | No | 5672 | No | AMQP port: 5672 plain, usually 5671 with TLS. |
brokerType | enum: activemq, artemis, generic | No | activemq | No | How queue and topic names become AMQP addresses: activemq (queue://name, topic://name), artemis or generic (the name with a queue or topic capability). |
username | string | No | No | SASL PLAIN user name. Empty: SASL ANONYMOUS. | |
password | string | No | Yes | SASL PLAIN password (encrypted at rest). | |
virtualHost | string | No | No | AMQP hostname sent on open (a virtual host or namespace); defaults to host. | |
clientId | string | No | No | AMQP container id (the JMS client id). A durable topic subscription is kept under it, so keep it stable. | |
tlsEnabled | boolean | No | false | No | Connect over TLS (AMQPS). Off sends the password and messages in clear text. |
tlsCaPem | string | No | Yes | PEM CA certificate(s) to verify the server against. See tlsCaMode. | |
tlsCaMode | enum: replace, add | No | No | Trust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem. | |
tlsClientCertPem | string | No | Yes | PEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem. | |
tlsClientKeyPem | string | No | Yes | PEM private key for the client certificate (encrypted at rest). | |
tlsClientPfx | string | No | Yes | Client certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair. | |
tlsClientPassphrase | string | No | Yes | Passphrase of the PKCS#12 bundle. | |
tlsMinVersion | enum: TLSv1.2, TLSv1.3 | No | No | Lowest TLS version to accept (default TLSv1.2). | |
tlsServername | string | No | No | Host name to verify (SNI); defaults to host. Needs tlsEnabled. | |
timeout | number | No | 30000 | No | Milliseconds to wait for the connection and for the broker to settle a sent message. |
idleTimeoutMs | number | No | 60000 | No | AMQP idle timeout (heartbeat) in milliseconds; 0 turns heartbeats off. |
Actions
A trailing ? marks an optional step parameter. A message can supply only the keys in the last column; everything else comes from the step.
| Action | What it does | Step parameters | Keys a message may supply |
|---|---|---|---|
send | Put the message on a queue or topic and wait for the broker to accept it. | destination, destinationType?, body?, contentType?, properties?, correlationId?, priority?, ttlMs?, persistent? | body |
Minimal example
The smallest profile the engine accepts: the required settings only, with synthetic values. Create it with POST /api/adapter-profiles, then test it with POST /api/adapter-profiles/{id}/test.
{
"name": "JMS (AMQP 1.0) (example)",
"adapterType": "jms",
"config": {
"host": "example-host"
}
}Limits
- The broker host goes through the engine's SSRF check: a host that resolves to a private address needs
SSRF_ALLOWLIST(see Environment variables). The engine connects to the address it checked. - One connection per profile is kept open for sends and closed after a minute idle; each send opens and closes its own link.
- Not supported: JMS transactions, temporary reply queues (request/reply waits), and the Java JMS ObjectMessage and StreamMessage types. A MapMessage that arrives on the listener is passed on as a JSON object.
- Message properties take strings, numbers and booleans (at most 64, names of letters, digits,
_,$,.and-). - Errors name the broker's AMQP condition (for example
amqp:unauthorized-access), never the password or message content.
JMS Listener trigger
A jms trigger consumes a queue or topic through a jms profile. One engine replica holds each trigger at a time (a lease that another replica takes over within a minute if the holder stops). Each message becomes a pending run before it is acknowledged to the broker, so a crash redelivers it, and the JMS message id keeps that redelivery from running twice. A message the trigger's filter drops is acknowledged; one that can't be recorded (license, PHI, backlog, shutdown) is released back to the broker and the listener reconnects after a backoff. A message over JMS_MAX_MESSAGE_BYTES (10 MiB by default) is rejected, which sends it to the broker's dead-letter queue. A durable topic subscription (subscriptionName) keeps messages while no engine is connected; its client id is the profile's clientId, else medhook-<workflowId>. See Triggers.