Help - Not Receiving Acknowledgment When Publishing to NATS JetStream’s Subject in FastStream #1895
-
I am working with FastStream and trying to publish messages to a NATS JetStream, but I’m not seeing any acknowledgment data returned when I attempt to publish. Below is the code snippet I’m using: class TestPublisher(ABCPublisher):
def __init__(self, logger: Logger = Depends(Logger)):
self._logger = logger
self._broker = NatsBroker("nats://localhost:4222")
async def publish(self, stream: str, subject: str, message: dict):
async with self._broker:
try:
ack = await self._broker.publish(stream=stream, subject=subject, message=message)
print(ack) # This prints 'None'
except Exception as e:
self._logger.error(f"Failed to publish message: {e}") I expected ack to contain some acknowledgment details (e.g., a confirmation that the message was successfully stored in the stream). However, the output is None, which makes it unclear if the message was acknowledged or stored. Questions:
Any insights or suggestions would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@Atanusaha143 sorry, now we have a some architecture mistakes and we lost this functional - https://github.com/airtai/faststream/blob/main/faststream/nats/publisher/producer.py#L80 The problem related to |
Beta Was this translation helpful? Give feedback.
-
Should be merged with #1779 - it is already in the branch |
Beta Was this translation helpful? Give feedback.
Yes