You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add an update_consumer method for jet stream, same as the one in the javascript library.
What is the proposed change?
pretty much a copy/paste of add_consumer just updated subject to "CONSUMER.UPDATE"
async def update_consumer(
self,
stream: str,
consumer: str,
config: Optional[api.ConsumerUpdateConfig] = None, # Assuming a similar class exists
timeout: Optional[float] = None,
**params,
) -> api.ConsumerInfo:
if not timeout:
timeout = self._timeout
if config is None:
config = api.ConsumerUpdateConfig() # Assuming a similar class exists
config = config.evolve(**params)
req = {"stream_name": stream, "consumer_name": consumer, "config": config.as_dict()} # Adjusted key names
req_data = json.dumps(req).encode()
# The subject format is speculative and should be replaced with the correct format.
subject = f"{self._prefix}.CONSUMER.UPDATE.{stream}.{consumer}"
resp = await self._api_request(subject, req_data, timeout=timeout)
return api.ConsumerInfo.from_response(resp)
Who benefits from this change?
Everyone. Allows changeable items in the consumer configs to be updated.
What alternatives have you evaluated?
The only alternative is to delete and recreate a new consumer. Which is not the most suitable option.
The text was updated successfully, but these errors were encountered:
What motivated this proposal?
Add an
update_consumer
method for jet stream, same as the one in the javascript library.What is the proposed change?
pretty much a copy/paste of add_consumer just updated subject to "CONSUMER.UPDATE"
Who benefits from this change?
Everyone. Allows changeable items in the consumer configs to be updated.
What alternatives have you evaluated?
The only alternative is to delete and recreate a new consumer. Which is not the most suitable option.
The text was updated successfully, but these errors were encountered: