The Management interface¶
Source: settings.go (the interface and its types), artemis.go (the implementation).
Every method takes the *goamqp.Session so a Management can speak over the same connection as the
backend.
type Management interface {
Features(ctx context.Context, sess *goamqp.Session) (Features, error)
Describe(ctx context.Context, sess *goamqp.Session, address, queue string) (QueueInfo, error)
Routes(ctx context.Context, sess *goamqp.Session, address string) (bool, error)
Create(ctx context.Context, sess *goamqp.Session, spec QueueSpec) error
Delete(ctx context.Context, sess *goamqp.Session, address, queue string) error
}
| Method | Asked | By |
|---|---|---|
Features |
what the broker is configured to offer | New, once |
Describe |
a queue on an address, as the broker holds it; ErrNotFound if it does not exist |
each AtLeastOnce subscribe |
Routes |
whether a publish to an address reaches any queue | the first publish to each address in a session |
Create, Delete |
make or remove a queue | nothing in the backend; they exist for a Topology or an operator's tool |
The backend itself never calls Create or Delete. The module's test fixture calls
Artemis{}.Create from its Topology.
Types¶
| Type | Fields |
|---|---|
Features |
PersistsDeliveryCount, Persists, Deduplicates, DeadLetters (all bool) |
QueueInfo |
Address, RoutingType ("MULTICAST" or "ANYCAST"), Durable, Filter, MaxDeliveryAttempts, DeadLetterAddress, DeadLetterHasQueue |
QueueSpec |
Name, Address, RoutingType, Durable, Filter |
Of Features, the backend reads PersistsDeliveryCount and Persists for capabilities and
Deduplicates to decide whether to key the broker's duplicate cache. DeadLetters is set by Artemis
and not read by the backend.
Artemis¶
Artemis{} speaks the broker's management address, activemq.management, over the same connection:
attribute reads and operation invocations as messages with a dynamic reply address. No second
endpoint and no HTTP. The code comment says it needs Artemis 2.44.0 or later; the suite now runs
2.57.0 only, see Tested versions.
| Method | What Artemis is asked |
|---|---|
Features |
attributes PersistDeliveryCountBeforeDelivery, PersistenceEnabled, JournalSyncNonTransactional of broker. Deduplicates and DeadLetters are set true without asking. |
Describe |
attributes Address, RoutingType, Durable and Filter of queue.<name>; then the operation getAddressSettingsAsJSON for the address, taking maxDeliveryAttempts and deadLetterAddress; then the attribute QueueNames of address.<dead-letter address>. |
Routes |
QueueNames of address.<address>, and if none, AddressNames of broker filtered to wildcard addresses that match, each checked for queues. |
Create |
operation createQueue with a JSON configuration and ignore-if-exists, so creating a queue that exists is not an error. |
Delete |
operation destroyQueue with the queue name. |
Each request has a 10 second budget. A reply that says the operation did not succeed becomes
ErrNotFound when its text contains does not exist or Problem while retrieving, and
ErrManagementRefused otherwise. See Errors.
Writing another¶
Nothing broker-specific is in the backend's spine, so a Management for another AMQP 1.0 broker is
the extension point. No other implementation ships, and none has been run against the suite: see
Limits and gaps.