Skip to content

AmqpActor

Defined in: src/io/broker/AmqpActor.ts:63

AMQP 0.9.1 actor backed by amqplib. One connection, one channel shared by producer + consumers. Bindings (queue↔exchange↔routingKey) are configured up-front in settings; runtime additions go through tell({ kind: 'subscribe', ... }) (currently out-of-scope — add when needed).

autoAck=true (default) means the consumer acks the message when it was delivered to the actor, not when the actor finished processing. For at-least-once-with-processing, set autoAck=false and have your handler tell back { kind: 'ack' / 'nack', delivery }.

new AmqpActor(settings?): AmqpActor

Defined in: src/io/broker/AmqpActor.ts:70

Partial<AmqpActorSettings> = {}

AmqpActor

BrokerActor<AmqpActorSettings, AmqpCmd, AmqpPublish>.constructor

onReceive(cmd): void

Defined in: src/io/broker/AmqpActor.ts:147

Main message handler. Receives each envelope dequeued from the mailbox. A thrown error (sync or async) is caught by the supervisor.

AmqpCmd

void

BrokerActor.onReceive


postRestart(_reason): void | Promise<void>

Defined in: src/Actor.ts:55

Called on the fresh instance after a restart. Default: call preStart().

Error

void | Promise<void>

BrokerActor.postRestart


postStop(): Promise<void>

Defined in: src/io/broker/BrokerActor.ts:241

Called after the actor has been terminated. Children are already stopped.

Promise<void>

BrokerActor.postStop


preRestart(_reason, _message?): void | Promise<void>

Defined in: src/Actor.ts:50

Called before a restart, on the instance about to be thrown away. The default stops children and then calls postStop().

Error

AmqpCmd

void | Promise<void>

BrokerActor.preRestart


preStart(): Promise<void>

Defined in: src/io/broker/BrokerActor.ts:235

Called after construction and before the first message is processed.

Promise<void>

BrokerActor.preStart


supervisorStrategy(): SupervisorStrategy

Defined in: src/Actor.ts:63

Supervisor strategy for this actor’s children. Defaults to restart, up to 10 times per minute, then stop.

SupervisorStrategy

BrokerActor.supervisorStrategy