IPWorks MQ 2020 Node.js Edition

Questions / Feedback?

EnablePublishConfirms Method

Enables publish confirmations mode for a channel.

Syntax

amqpclassic.enablePublishConfirms(channelName, noWait, [callback])

Callback

The 'callback' parameter specifies a function which will be called when the operation completes (or an error is encountered). If the 'callback' parameter is not specified, then the method will block and will not return until the operation completes (or an error is encountered).

The callback for this method is defined as:

function(err){ }

'err' is the error that occurred. If there was no error, then 'err' is 'null'.

'err' has 2 properties which hold detailed information:

err.code
err.message

Remarks

This method enables publish confirmations mode for the channel with the given ChannelName.

While a channel is in publish confirmations mode, the server will acknowledge each message published by the class. The class will wait to fire the MessageOut event until it receives this acknowledgement. (Note that this mode is only available when the RabbitMQCompatible configuration setting is enabled.)

Note that a channel will stay in publish confirmations mode, once enabled, until it is deleted.

The NoWait parameter, if True, will cause the server to execute the request asynchronously. For asynchronous request handling, the server only sends back a response in case of an error.

An exception is thrown if the RabbitMQCompatible configuration setting is currently False, if no channel with the given ChannelName exists, or if EnableTransactionMode has been called for the specified channel previously.

Copyright (c) 2022 /n software inc. - All rights reserved.
IPWorks MQ 2020 Node.js Edition - Version 20.0 [Build 8155]