Skip to content

Message listener

*.listener binds a JS / TS handler to a queue or topic on the embedded ActiveMQ broker.

File format

json
{
    "location": "/myproject/listeners/orders.listener",
    "name": "orders-queue",
    "kind": "Q",
    "handler": "myproject/listeners/orders-handler.js",
    "description": "Process incoming orders"
}
FieldPurpose
locationRegistry path of the descriptor itself.
nameQueue / topic name on the broker.
kindQ for queue, T for topic.
handlerRegistry path of the JS / TS module that receives each message.
descriptionFree text.

The handler module is invoked once per message. The message body and headers are available to the handler via the messaging context.

Java alternative - @MessageListener

A client .java class annotated with @MessageListener(name = "orders-queue", kind = QUEUE) is registered without a .listener artefact. See Message listeners for the full annotation surface.

.listener is preferred when the binding should live in the registry and reload without restart. Use the annotation when you want the handler and binding to ship as one Java source.

Tenancy

Listener subscriptions are tenant-isolated - each tenant's reconciled .listener files own their own subscriptions on the broker.

Released under the EPL-2.0 License.