Skip to content
Reference

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.

On this page

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

BrokerbrokerTypeNotes
ActiveMQ Classic 5.xactivemqEnable 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 ArtemisartemisThe 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 latergenericDefine 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 BusgenericAMQP 1.0 natively; use the queue or topic name as the address.

Auth

  • SASL PLAIN with username and password; 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, and tlsServername when the certificate's name differs from host. 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.

SettingTypeRequiredDefaultSecretDescription
hoststringYesNoBroker host name or IP address.
portnumberNo5672NoAMQP port: 5672 plain, usually 5671 with TLS.
brokerTypeenum: activemq, artemis, genericNoactivemqNoHow queue and topic names become AMQP addresses: activemq (queue://name, topic://name), artemis or generic (the name with a queue or topic capability).
usernamestringNoNoSASL PLAIN user name. Empty: SASL ANONYMOUS.
passwordstringNoYesSASL PLAIN password (encrypted at rest).
virtualHoststringNoNoAMQP hostname sent on open (a virtual host or namespace); defaults to host.
clientIdstringNoNoAMQP container id (the JMS client id). A durable topic subscription is kept under it, so keep it stable.
tlsEnabledbooleanNofalseNoConnect over TLS (AMQPS). Off sends the password and messages in clear text.
tlsCaPemstringNoYesPEM CA certificate(s) to verify the server against. See tlsCaMode.
tlsCaModeenum: replace, addNoNoTrust: replace = only this CA (default), add = the system CAs plus this CA. Needs tlsCaPem.
tlsClientCertPemstringNoYesPEM client certificate, for servers that require mutual TLS. Set with tlsClientKeyPem.
tlsClientKeyPemstringNoYesPEM private key for the client certificate (encrypted at rest).
tlsClientPfxstringNoYesClient certificate and key as a base64 PKCS#12 (.p12 / .pfx) bundle, instead of the PEM pair.
tlsClientPassphrasestringNoYesPassphrase of the PKCS#12 bundle.
tlsMinVersionenum: TLSv1.2, TLSv1.3NoNoLowest TLS version to accept (default TLSv1.2).
tlsServernamestringNoNoHost name to verify (SNI); defaults to host. Needs tlsEnabled.
timeoutnumberNo30000NoMilliseconds to wait for the connection and for the broker to settle a sent message.
idleTimeoutMsnumberNo60000NoAMQP 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.

ActionWhat it doesStep parametersKeys a message may supply
sendPut 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.

json
{
  "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.