IPWorks MQ 2020 Node.js Edition

Questions / Feedback?

ChannelMode Property

What mode the channel is operating in.

Syntax

 amqpclassic.getChannelMode(index, [callback])

Possible Values

  0 (cmtNormal), 
  1 (cmtTransactional), 
  2 (cmtPublishConfirms)

Default Value

0

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 the getChannelMode([callback]) method is defined as:

function(err, data){ }

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

'data' is the value returned by the method.

The callback for the setChannelMode([callback]) 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

What mode the channel is operating in.

This property reflects what mode the channel is operating in. Possible values are:

  • cmtNormal (0 - default): Normal mode.
  • cmtTransactional (1): Transaction mode.
  • cmtPublishConfirms (2): Publish confirmations mode.

All channels are in normal mode when they are created; there's nothing special about a channel in normal mode.

Channels can be put in transaction mode using the EnableTransactionMode method. While a channel is in transaction mode, all messages published and acknowledgements sent over it will be part of a transaction, and the server will wait to process them until the transaction is either committed or rolled back.

Channels can be put in publish confirmations mode using the EnablePublishConfirms method. 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: Switching a channel to transaction or publish confirmations mode is a permanent action; the channel will then remain in that mode for the remainder of its lifetime.

The index parameter specifies the index of the item in the array. The size of the array is controlled by the ChannelCount property.

This property is read-only and not available at design time.

Data Type

Integer

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