Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deliver policy can not be updated when recreating ordered consumer #657

Open
debajyoti-truefoundry opened this issue Jan 28, 2025 · 0 comments
Labels
defect Suspected defect such as a bug or regression

Comments

@debajyoti-truefoundry
Copy link

Observed behavior

Traceback:

2025-01-28 04:31:01,143 - WARNING - NATS connection event: disconnected
WARNING:placeholder.logger:NATS connection event: disconnected
2025-01-28 04:31:01,161 - WARNING - NATS connection event: reconnected
WARNING:placeholder.logger:NATS connection event: reconnected
2025-01-28 04:31:04,324 - ERROR - NATS error
Traceback (most recent call last):
  File "/app/.venv/lib/python3.12/site-packages/nats/js/client.py", line 852, in recreate_consumer
    cinfo = await self._js._jsm.add_consumer(
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/nats/js/manager.py", line 235, in add_consumer
    resp = await self._api_request(subject, req_data, timeout=timeout)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/nats/js/manager.py", line 394, in _api_request
    raise APIError.from_error(resp['error'])
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/app/.venv/lib/python3.12/site-packages/nats/js/errors.py", line 84, in from_error
    raise ServerError(**err)
nats.js.errors.ServerError: nats: ServerError: code=500 err_code=10012 description='deliver policy can not be updated'

This is how I create the ordered consumer:

self._sub = await _global_js.subscribe(
    subject=self._state_subject,
    stream="stream-name-placeholder",
    config=ConsumerConfig(
        name=f"consumer-{uuid.uuid4().hex}",
    ),
    cb=self._append_message,
    ordered_consumer=True,
)

Expected behavior

There won't be any error while recreating the ordered consumer.

Server and client version

Client version: "nats-py[nkeys]==2.9.0"
Server version: nats:2.10.24-alpine3.21

Host environment

No response

Steps to reproduce

No response

@debajyoti-truefoundry debajyoti-truefoundry added the defect Suspected defect such as a bug or regression label Jan 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Suspected defect such as a bug or regression
Projects
None yet
Development

No branches or pull requests

1 participant