Configuration

This page provides a detailed explanation of key configuration settings for RabbitMQ in the SDK. These settings allow you to optimize message handling, ensure reliable processing, and maintain stable connections. Below is a breakdown of each setting, its functionality, and the implications for your integration.

PrefetchCount:

  • This setting controls the number of messages that RabbitMQ will send to the consumer at once before waiting for acknowledgments. Essentially, it prevents the consumer from being overwhelmed by too many messages.

  • In your case, setting PrefetchCount to 100 means RabbitMQ will send up to 100 messages to your consumer at a time, and it will wait until the consumer acknowledges these messages before sending more.

AutoAck:

  • This stands for "Automatic Acknowledgment."

  • If set to true, messages are automatically acknowledged as soon as they are delivered to the consumer, without waiting for confirmation that the message has been processed.

  • While this reduces complexity, it can lead to message loss if the consumer crashes or fails before processing the message. Setting AutoAck to false would mean the consumer must manually acknowledge the messages, ensuring they are only acknowledged after successful processing.

RequestedHeartbeatSeconds:

  • This sets the heartbeat interval between the RabbitMQ server and the consumer in seconds.

  • A heartbeat is a lightweight way for the server and client to check if the connection is still alive. In your case, setting RequestedHeartbeatSeconds to 30 means the client and server will exchange heartbeats every 30 seconds to ensure the connection is still active.

NetworkRecoveryInterval:

  • This defines the interval (in seconds) between connection recovery attempts if the connection to RabbitMQ is lost.

  • Setting this to 30 means that, if the connection is interrupted, the system will wait 30 seconds before trying to reconnect to RabbitMQ.

DispatchConsumersAsync:

  • This enables asynchronous dispatching of messages to consumers.

  • If set to true, messages are processed asynchronously, which can improve performance, especially when multiple consumers are handling messages concurrently. This is useful when you want to prevent the consumer thread from being blocked while processing messages.

AutomaticRecoveryEnabled:

  • This flag enables or disables the automatic recovery of RabbitMQ connections.

  • When set to true, if the connection to RabbitMQ is lost, the client will automatically attempt to recover the connection without any manual intervention. This is particularly useful in production environments where high availability is critical, as it helps to minimize downtime due to network or server issues.

These configurations help tailor the SDK to your system's requirements, ensuring efficient message processing, reliable delivery, and robust RabbitMQ connection management. For more information read RabbitMQ docs.

Last updated