1 MetaAPIs
Ralph Schaer edited this page 2026-10-30 16:08:52 +01:00

Meta APIs

Meta APIs are ordinary WAMP procedures implemented by annotated Spring beans. They inspect the router's shared scope; results are not filtered by the client's HELLO realm. Configure access with Security, especially for session termination and history retrieval.

Examples use an established AutobahnJS session and run inside an async function. Procedure results below are returned as one positional value unless described as empty.

Enablement

API Required configuration
Registration DEALER and DEALER_REGISTRATION_META_API; broker needed to deliver its event topics
Subscription and history retrieval BROKER and BROKER_SUBSCRIPTION_META_API; dealer needed to call its procedures
Session BROKER, DEALER, BROKER_SESSION_META_API, and DEALER_SESSION_META_API
Testament BROKER, DEALER, and DEALER_TESTAMENT_META_API
Reflection Bean created when either router role is enabled; dealer needed for RPC access

All these flags default to enabled. History recording separately depends on BROKER_EVENT_HISTORY; disabling recording does not unregister get_events or clear an existing custom store.

Registrations

Procedure Positional arguments Result
wamp.registration.list None IDs grouped under exact, prefix, wildcard
wamp.registration.lookup URI, optional {match: "exact"} ID for that URI/policy, or null
wamp.registration.match Concrete procedure URI Registration selected by routing, or null
wamp.registration.get Registration ID id, created, uri, match, invoke
wamp.registration.list_callees Registration ID Callee WAMP session IDs
wamp.registration.count_callees Registration ID Number of callees

Unknown IDs in get/callee queries return wamp.error.no_such_registration. These APIs inspect client registrations in ProcedureRegistry; annotated Java procedures are held separately by the dealer and are not listed here.

Topics: wamp.registration.on_create, wamp.registration.on_register, wamp.registration.on_unregister, wamp.registration.on_delete. Creation carries the initiating session ID and a registration-detail object; other events carry the session ID and registration ID.

Subscriptions

Procedure Positional arguments Result
wamp.subscription.list None IDs grouped under exact, prefix, wildcard
wamp.subscription.lookup URI, optional {match: "exact"} ID for that URI/policy, or null
wamp.subscription.match Concrete topic URI All matching subscription IDs
wamp.subscription.get Subscription ID id, created, uri, match
wamp.subscription.list_subscribers Subscription ID Remote subscriber WAMP session IDs
wamp.subscription.count_subscribers Subscription ID Number of remote subscribers
wamp.subscription.get_events Subscription ID History entries; filters go in call keyword arguments

Unknown IDs return wamp.error.no_such_subscription. Local listeners share the subscription registry but do not have remote subscriber session IDs.

Topics: wamp.subscription.on_create, wamp.subscription.on_subscribe, wamp.subscription.on_unsubscribe, wamp.subscription.on_delete. Creation carries the initiating session ID and subscription details; the other topics carry the session ID and subscription ID.

const id = await session.call("wamp.subscription.lookup", ["news.local"]);
if (id !== null) {
  const events = await session.call("wamp.subscription.get_events", [id], {
    limit: 20,
    reverse: true
  });
}

History options are topic, limit, reverse, from_publication, after_publication, before_publication, until_publication, from_time, after_time, before_time, and until_time. from/until boundaries are inclusive; after/before are exclusive. Time values are ISO offset date/time strings. Publication boundaries refer to positions in stored occurrence order, not numeric ID sorting; an unknown boundary publication yields an empty list.

Entries contain timestamp, subscription, publication, details, and optional args/kwargs. Retrieval excludes publications with session-ID eligible/exclude lists, and applies auth-ID/auth-role filters to the requesting caller. See PubSub for storage lifetime and custom EventStore requirements.

Sessions

Procedure Positional arguments Result
wamp.session.count Optional list of auth roles Count
wamp.session.list Optional list of auth roles WAMP session IDs
wamp.session.get Session ID Session/auth/transport details
wamp.session.kill Session ID Empty result after sending termination
wamp.session.kill_by_authid Auth ID IDs of sessions targeted
wamp.session.kill_by_authrole Auth role Count of sessions targeted
wamp.session.kill_all None Count of sessions targeted

Termination methods accept optional reason and message keyword arguments and send GOODBYE; the default reason is wamp.close.killed. Bulk operations exclude the caller. Trying to kill the calling session or an unknown individual session returns wamp.error.no_such_session. Results indicate the termination request was sent, not that the peer has acknowledged it.

get returns session, authid, authrole, authmethod, authprovider, and transport.websocket_session_id. The transport field also carries the long-poll transport ID for that transport. It does not include a realm.

Topics: wamp.session.on_join carries session details; wamp.session.on_leave carries the session ID, auth ID, and auth role.

Testaments

wamp.session.add_testament takes positional [topic, args, kwargs] and optional keyword scope and publish_options. Omit unused trailing payload arguments. Scope is destroyed by default; detached is also accepted.

await session.call("wamp.session.add_testament",
  ["presence.left", ["worker-1"], {}],
  {scope: "destroyed"});

// Remove pending testaments in this scope without publishing them.
await session.call("wamp.session.flush_testaments", [], {scope: "destroyed"});

wamp.session.add_testament and wamp.session.flush_testaments both return an empty result and operate on the calling session. On disconnect the implementation drains detached first, then destroyed, preserving insertion order within each scope. It does not provide session resumption or separate durable attachment state.

publish_options supports exclude_me, disclose_me, retain, session-ID inclusion/exclusion, and auth-ID/auth-role inclusion/exclusion. The eventual publication uses WampPublisher and passes through broker authorization. A testament is server-originated; its payload should carry any application identity the consumer needs.

Reflection

Procedure Arguments Result
wamp.reflection.procedure.list None Registered procedure URIs
wamp.reflection.procedure.describe URI Registration metadata, or null
wamp.reflection.topic.list None Registered topic URIs
wamp.reflection.topic.describe URI Subscription metadata, or null
wamp.reflection.error.list None Known WampError error URIs
wamp.reflection.error.describe URI uri, enum name, and type, or null

Reflection reports runtime registry metadata, not Java parameter schemas or a general application type registry. Procedure reflection does not enumerate annotated Java procedures. There is no separate Feature constant for reflection.

Source: meta API implementations.