Skip to content

Connection showing one only of multiple sentinel servers defined #2248

@dan-developer

Description

@dan-developer
  • Python 3.12.9
  • Celery 5.3.1
  • Kombu 5.3.2

When I configure multiple sentinels to celery broker, when celery starts show only one of this sentinels.

I configured following documentation: https://docs.celeryq.dev/projects/kombu/en/stable/userguide/connections.html#urls

So, I did an example code to test:

      with Connection('sentinel://0.0.0.0:26347/3;sentinel://0.0.0.0:26348/3') as conn:
          print(conn.as_uri())

This output the following: sentinel://0.0.0.0:26347/3
And not show the another two sentinels defined.

Trying with another option, in this case, amqp:

      with Connection('amqp://foo;amqp://bar') as conn:
          print(conn.as_uri())

This output the following: amqp://guest:**@foo:5672//
And not show the another two amqp defined.

I've read the kombu code to make sure that I thinking correctly:

class SentinelChannel(Channel):
    """Channel with explicit Redis Sentinel knowledge.

    Broker url is supposed to look like:

    .. code-block::

        sentinel://0.0.0.0:26379;sentinel://0.0.0.0:26380/...

    where each sentinel is separated by a `;`.

    Other arguments for the sentinel should come from the transport options
    (see `transport_options` of :class:`~kombu.connection.Connection`).

    You must provide at least one option in Transport options:
     * `master_name` - name of the redis group to poll

    Example:
    -------
    .. code-block:: python

        >>> import kombu
        >>> c = kombu.Connection(
             'sentinel://sentinel1:26379;sentinel://sentinel2:26379',
             transport_options={'master_name': 'mymaster'}
        )
        >>> c.connect()
    """

Could you help me?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions