TsgcWSPClient_AMQPMethods › DeclareExchangeEx

DeclareExchangeEx Method

Declares an exchange synchronously, waiting for exchange.declare-ok.

Syntax

function DeclareExchangeEx(const aChannel, aExchange: string; const aExchangeType: string = ''; aPassive: Boolean = false; aDurable: Boolean = false; aAutoDelete: Boolean = false; aInternal: Boolean = false; aNoWait: Boolean = false; aTimeout: Integer = CS_AMQP_DEFAULT_TIMEOUT; const aArguments: string = ''): Boolean;

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.
aTimeoutIntegerMaximum time in milliseconds to wait for the broker confirmation before returning False.
aArgumentsconst stringOptional JSON-encoded field-table with additional arguments.

Return Value

True when the broker acknowledged the exchange declaration within aTimeout. (Boolean)

Remarks

Extended synchronous variant of DeclareExchange. Returns True once the broker has acknowledged the declaration; returns False on timeout or declaration mismatch.

Example

if sgcWSPClient_AMQP1.DeclareExchangeEx('ch1', 'ex.orders', 'topic', False, True) then
  ;

Back to Methods