TsgcWSPClient_AMQPMethods › DeclareExchange

DeclareExchange Method

Declares an exchange on the broker (exchange.declare).

Syntax

procedure DeclareExchange(const aChannel, aExchange: string; const aExchangeType: string = ''; aPassive: Boolean = false; aDurable: Boolean = false; aAutoDelete: Boolean = false; aInternal: Boolean = false; aNoWait: Boolean = false; const aArguments: string = '');

Parameters

NameTypeDescription
aChannelconst stringName of the open AMQP channel on which the operation is issued.
aExchangeconst stringName of the exchange.
aExchangeTypeconst stringExchange type: direct, topic, fanout or headers.
aPassiveBooleanWhen True the broker checks whether the object exists and raises an error if it does not, without creating it.
aDurableBooleanWhen True the object survives broker restarts.
aAutoDeleteBooleanWhen True the object is deleted once the last client stops using it.
aInternalBooleanWhen True the exchange is reserved for broker-internal use and cannot receive direct publishes.
aNoWaitBooleanWhen True the client does not wait for the broker to confirm the operation.
aArgumentsconst stringOptional JSON-encoded field-table with additional arguments.

Remarks

Creates the exchange if it does not exist, or validates its properties if it does. Supports all standard AMQP 0-9-1 exchange types (direct, topic, fanout, headers).

Example

sgcWSPClient_AMQP1.DeclareExchange('ch1', 'ex.orders', 'topic', False, True);

Back to Methods