Apache ActiveMQ Artemis driver
babelqueue-artemis is a drop-in queue connection that makes an Apache ActiveMQ
Artemis broker polyglot from Laravel. Artemis speaks AMQP 1.0 (not RabbitMQ’s
0-9-1) and has no strong native PHP client, so this driver reaches it over STOMP
(the §7 PHP path — ADR-0018).
Artemis bridges STOMP ↔ AMQP 1.0 ↔ JMS on the same address, so a message this driver
produces is consumed natively by the Java (JMS) and .NET / Node / Python / Go (AMQP 1.0)
Artemis SDKs — and vice versa.
Unlike the produce-only framework-less StompTransport,
this Laravel driver produces and consumes: it’s a full queue connection, so the
standard worker pops, routes by URN and acks/releases.
Requirements
The pure-PHP STOMP client is required:
composer require stomp-php/stomp-php
Configuration
Add a connection in config/queue.php with driver set to babelqueue-artemis:
'connections' => [
'babelqueue-artemis' => [
'driver' => 'babelqueue-artemis',
'host' => env('ARTEMIS_HOST', '127.0.0.1'),
'port' => env('ARTEMIS_PORT', 61613), // Artemis STOMP acceptor
'username' => env('ARTEMIS_USER', 'artemis'),
'password' => env('ARTEMIS_PASSWORD', 'artemis'),
'queue' => env('BABELQUEUE_QUEUE', 'orders'),
'options' => ['ssl' => false], // 'ssl' => true uses stomp+ssl
],
],
The connector hands the queue a lazy factory (no eager socket), so it builds and connects the STOMP client on first use and reconnects transparently after a drop — mirroring the RabbitMQ connector.
Produce
Producing is identical to the other BabelQueue drivers — see Producing messages. Send to the anycast address (the default for an auto-created JMS queue) so the JMS/AMQP-1.0 consumers receive it:
use BabelQueue\Facades\BabelQueue;
BabelQueue::connection('babelqueue-artemis')
->publish('urn:babel:orders:created', ['order_id' => 1042]);
The envelope JSON is the STOMP frame body (authoritative); trace_id rides the
native correlation-id header, and the §7 bq_ application properties
(bq_schema_version / bq_source_lang / bq_attempts / bq_app_id) use underscores
because a JMS property name must be a valid Java identifier
(ADR-0017).
Consume
Run the standard worker against the connection:
php artisan queue:work babelqueue-artemis
Polyglot messages — including those produced by another language’s SDK over JMS or AMQP 1.0 — are decoded, routed by URN through the dispatcher and handled; standard Laravel jobs on the same connection run as normal. Register handlers exactly as for any other driver — see Consuming messages.
Routing is body-authoritative (§7.8). A STOMP custom header can’t set the
x-opt-jms-typeannotation the §7 consumers prefer, so routing falls back to the envelope’sjobURN — which is always present, so a STOMP-produced message routes correctly against every Artemis SDK.
Because the wire format is the canonical envelope, a message your Laravel app consumes may have been produced by any BabelQueue SDK, and vice-versa. See the Artemis binding for the full native projection.