Platforms to show: All Mac Windows Linux Cross-Platform

Back to RabbitMQConnectionMBS class.

Next items

RabbitMQConnectionMBS.BasicAck(channel as Integer, deliveryTag as UInt64, multiple as Boolean = false) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Acknowledges a message.
Notes:
Does a basic.ack on a received message.

channel: the channel identifier
deliveryTag: the delivery tag of the message to be ack'd.
multiple: if true, ack all messages up to this delivery tag, if false ack only this delivery tag.

Returns error code, 0 on success, 0 > on failing to send the ack to the broker. this will not indicate failure if something goes wrong on the broker.

Some examples using this method:

RabbitMQConnectionMBS.BasicCancel(channel as Integer, consumerTag as String) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Cancels a channel.
RabbitMQConnectionMBS.BasicGet(channel as Integer, queue as String, noAck as Boolean) as RabbitMQRPCReplyMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Do a basic.get.
Notes:
Synchronously polls the broker for a message in a queue, and retrieves the message if a message is in the queue.

channel: the channel identifier to use
queue: the queue name to retrieve from
noAck: if true the message is automatically ack'ed if false BasicAck() should be called once the message retrieved has been processed

Returns RabbitMQRPCReplyMBS object indicating success or failure
RabbitMQConnectionMBS.BasicNAck(channel as Integer, deliveryTag as UInt64, multiple as Boolean = false, requeue as Boolean = false) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Do a basic.nack.
Notes:
Actively reject a message, this has the same effect as BasicReject() however, BasicNAck() can negatively acknowledge multiple messages with one call much like BasicAck() can acknowledge mutliple messages with
one call.

channel: the channel identifier
deliveryTag the delivery tag of the message to reject
multiple: if set to 1 negatively acknowledge all unacknowledged messages on this channel.
requeue: indicate to the broker whether it should requeue the message or dead-letter it.

Returns error code, kStatusOK on success, an status constant value otherwise.

RabbitMQConnectionMBS.BasicPublish(channel as Integer, exchange as String, routingKey as String, mandatory as Boolean, immediate as Boolean, properties as RabbitMQBasicPropertiesMBS, body as String) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Publish a message to the broker.
Notes:
Publish a message on an exchange with a routing key.

Note that at the AMQ protocol level basic.publish is an async method:
this means error conditions that occur on the broker (such as publishing to
a non-existent exchange) will not be reflected in the return value of this
function.

channel: the channel identifier
exchange: the exchange on the broker to publish to
routingKey: the routing key to use when publishing the message mandatory indicate to the broker that the message MUST be routed to a queue. If the broker cannot do this it should respond with a basic.return method.
immediate: indicate to the broker that the message MUST be delivered to a consumer immediately. If the broker cannot do this it should respond with a basic.return method.
properties: the properties associated with the message
body: the message body

kStatusOK on success, other kStatus values on failure. Note that basic.publish is an async method, the return value from this function only indicates that the message data was successfully transmitted to the broker. It does not indicate failures that occur on the broker, such as publishing to a non-existent exchange.

Possible error values:
  • kStatusTimerFailure: system timer facility returned an error the message was not sent.
  • kStatusHeartbeatTimeout: connection timed out waiting for a heartbeat from the broker. The message was not sent.
  • kStatusNoMemory: memory allocation failed. The message was not sent.
  • kStatusTableTooBig: a table in the properties was too large to fit in a single frame. Message was not sent.
  • kStatusConnectionClosed: the connection was closed
  • kStatusSSLError: a SSL error occurred.
  • kStatusTCPError: a TCP error occurred. errno or WSAGetLastError() may provide more information.

Some examples using this method:

RabbitMQConnectionMBS.BasicQOS(channel as Integer, prefetchSize as Integer, prefetchCount as Integer, isGlobal as boolean) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Basic QOS.

Some examples using this method:

RabbitMQConnectionMBS.BasicRecover(channel as Integer, requeue as Boolean) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Recover a channel.
RabbitMQConnectionMBS.BasicReject(channel as Integer, deliveryTag as UInt64, requeue as Boolean = false) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Do a basic.reject.
Notes:
Actively reject a message that has been delivered

channel: the channel identifier
deliveryTag the delivery tag of the message to reject
requeue: indicate to the broker whether it should requeue the message or just discard it.

Returns error code, 0 on success, 0 > on failing to send the reject method to the broker.
This will not indicate failure if something goes wrong on the broker.
RabbitMQConnectionMBS.ChannelClose(Channel as Integer, Code as Integer = 200) as RabbitMQRPCReplyMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Closes an channel.
Notes:
channel: the channel identifier
code: the reason for closing the channel, kReplySuccess is a good default.

Returns RabbitMQRPCReplyMBS object indicating success or failure

Some examples using this method:

RabbitMQConnectionMBS.ChannelFlow(channel as Integer, active as Boolean) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Channel Flow control.
RabbitMQConnectionMBS.ConfirmSelect(channel as Integer) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Confirm select.
RabbitMQConnectionMBS.Constructor
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: The constructor.
Notes: Allocate and initialize a new connection object.
RabbitMQConnectionMBS.ConsumeMessage(byref envelope as RabbitMQEnvelopeMBS, timeoutValue as double = 30, flags as Integer = 0) as RabbitMQRPCReplyMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Wait for and consume a message.
Notes:
Waits for a basic.deliver method on any channel, upon receipt of basic.deliver it reads that message, and returns. If any other method is received before basic.deliver, this function will return an RabbitMQRPCReplyMBS with ReplyType = ResponseTypeLibraryException, and Reply.LibraryError = kStatusUnexpectedState. The caller should then call WaitFrame() to read this frame and take appropriate action.

This function should be used after starting a consumer with the BasicConsume() function

Envelope receives new object.
Timeout is in seconds.
flags: pass in 0. Currently unused.

Returns RabbitMQRPCReplyMBS, which may contain error information.
Type of the object is RabbitMQRPCReplyMBS.ResponseTypeNormal on success.

Some examples using this method:

RabbitMQConnectionMBS.Destructor
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: The destructor.
Notes:
Closes the entire connection.

Implicitly closes all channels and informs the broker the connection
is being closed, after receiving acknowledgment from the broker it closes
the socket.
RabbitMQConnectionMBS.ExchangeBind(channel as Integer, destination as String, source as String, routingKey as String, arguments as Dictionary) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Binds an exchange.
RabbitMQConnectionMBS.ExchangeDelete(channel as Integer, exchange as String, ifUsed as Boolean) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Deletes an exchange.
RabbitMQConnectionMBS.ExchangeUnbind(channel as Integer, destination as String, source as String, routingKey as String, arguments as Dictionary) as Dictionary
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Unbinds an exchange.
RabbitMQConnectionMBS.LoginExternal(vhost as String, channelMax as Integer, frameMax as Integer, heartbeat as Integer, Identity as String, properties as Dictionary = nil) as RabbitMQRPCReplyMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Login with external SASL.
Notes:
Login to the broker passing an optional properties table.

vhost: the virtual host to connect to on the broker. The default on most brokers is "/".
channelMax: the limit for the number of channels for the connection.
0 means no limit, and is a good default (kDefaultMaxChannels) Note that the maximum number of channels the protocol supports is 65535 (2^16, with the 0-channel reserved). The server can set a lower channelMax and then the client will use the lowest of the two.
frameMax: the maximum size of an AMQP frame ont he wire to request of the broker for this connection. 4096 is the minimum size, 2^31-1 is the maximum, a good default is 131072 (128KB), or kDefaultFrameSize.
heartbeat: the number of seconds between heartbeat frame to request of the broker. A value of 0 disables heartbeats. Note rabbitmq-c only has partial support for hearts, as of v0.4.0 heartbeats are only serviced during BasicPublish(), and SimpleWaitFrame() properties a table of properties to send the broker.
sasl_method the SASL method to authenticate with the properties.

Returns error code indicating success or failure via RabbitMQRPCReplyMBS object.

  • Reply.Type = kResponseNormal. Login completed successfully
  • Reply.Type = kResponseLibraryException. In most cases errors from the broker when logging in will be represented by the broker closing the socket. In this case r.libraryError will be set to kStatusConnectionClosed. This error can represent a number of error conditions including: invalid vhost, authentication failure.
  • Reply.Type = kResponseServerException. The broker returned an exception:
  • If Reply.MethodId = kChannelCloseMethod a channel exception occurred, check decoded properties to see details of the exception. The client should SendMethod() a kChannelCloseOkMethod. The channel must be re-opened before it can be used again. Any resources associated with the channel (auto-delete exchanges, auto-delete queues, consumers) are invalid and must be recreated before attempting to use them again.
  • If Reply.MethodId = kConnectionCloseMethod a connection exception occurred, check decoded properties to see details of the exception. The client SendMethod() a kConnectionCloseOkMethod and disconnect from the broker.
RabbitMQConnectionMBS.LoginPlain(vhost as String, channelMax as Integer, frameMax as Integer, heartbeat as Integer, Username as String, Password as String, properties as Dictionary = nil) as RabbitMQRPCReplyMBS
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Login with plain SASL.
Notes:
Login to the broker passing an optional properties table.

vhost: the virtual host to connect to on the broker. The default on most brokers is "/".
channelMax: the limit for the number of channels for the connection.
0 means no limit, and is a good default (kDefaultMaxChannels) Note that the maximum number of channels the protocol supports is 65535 (2^16, with the 0-channel reserved). The server can set a lower channelMax and then the client will use the lowest of the two.
frameMax: the maximum size of an AMQP frame ont he wire to request of the broker for this connection. 4096 is the minimum size, 2^31-1 is the maximum, a good default is 131072 (128KB), or kDefaultFrameSize.
heartbeat: the number of seconds between heartbeat frame to request of the broker. A value of 0 disables heartbeats. Note rabbitmq-c only has partial support for hearts, as of v0.4.0 heartbeats are only serviced during BasicPublish(), and SimpleWaitFrame() properties a table of properties to send the broker.
sasl_method the SASL method to authenticate with the properties.

Returns error code indicating success or failure via RabbitMQRPCReplyMBS object.

  • Reply.Type = kResponseNormal. Login completed successfully
  • Reply.Type = kResponseLibraryException. In most cases errors from the broker when logging in will be represented by the broker closing the socket. In this case r.libraryError will be set to kStatusConnectionClosed. This error can represent a number of error conditions including: invalid vhost, authentication failure.
  • Reply.Type = kResponseServerException. The broker returned an exception:
  • If Reply.MethodId = kChannelCloseMethod a channel exception occurred, check decoded properties to see details of the exception. The client should SendMethod() a kChannelCloseOkMethod. The channel must be re-opened before it can be used again. Any resources associated with the channel (auto-delete exchanges, auto-delete queues, consumers) are invalid and must be recreated before attempting to use them again.
  • If Reply.MethodId = kConnectionCloseMethod a connection exception occurred, check decoded properties to see details of the exception. The client SendMethod() a kConnectionCloseOkMethod and disconnect from the broker.

Some examples using this method:

RabbitMQConnectionMBS.MaybeReleaseBuffers
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Release connection owned memory.
Notes:
Release memory owned by the connection object related to any channel, allowing reuse by the library. Use of any memory returned by the library before this function is called with result in undefined behavior.

Internally rabbitmq-c tries to reuse memory when possible. As a result its possible calling this function may not have a noticeable effect on memory usage.
RabbitMQConnectionMBS.MaybeReleaseBuffersOnChannel(channel as Integer)
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Release connection owned memory related to a channel.
Notes:
Release memory owned by the amqp_connection_state_t object related to the specified channel, allowing reuse by the library. Use of any memory returned the library for a specific channel will result in undefined behavior.

Internally rabbitmq-c tries to reuse memory when possible. As a result its possible calling this function may not have a noticeable effect on memory usage.
RabbitMQConnectionMBS.NewTCPSocket(UseSSL as boolean = false) as Boolean
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Creates new socket.
Notes:
Optional uses OpenSSL to create a SSL socket if UseSSL is passed with value true.
Returns true on success.

Some examples using this method:

RabbitMQConnectionMBS.OpenSocket(Host as String, Port as Integer, TimeOut as Double = 10) as Integer
Type Topic Plugin Version macOS Windows Linux iOS Targets
method RabbitMQ MBS RabbitMQ Plugin 21.2 ✅ Yes ✅ Yes ✅ Yes ✅ Yes All
Function: Open a socket connection.
Notes:
This function opens a socket connection returned created with NewTCPSocket(). This function should be called after setting socket options.
Returns error code.

host: Connect to this host.
port: Connect on this remote port.
timeout: Max allowed time to spent on opening.

Some examples using this method:

Next items

The items on this page are in the following plugins: MBS RabbitMQ Plugin.


💬 Ask a question or report a problem
The biggest plugin in space...


Start Chat