We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 706037b commit a22c807Copy full SHA for a22c807
app/app.py
@@ -274,7 +274,7 @@ async def event_stream(
274
await websocket.accept()
275
_LOGGER.info("Accepted connection for %s", es_id)
276
277
- _LOGGER.info(
+ _LOGGER.debug(
278
"Creating Consumer for %s (%s:%s@%s/%s)...",
279
es_id,
280
_AMPQ_USERNAME,
@@ -289,6 +289,14 @@ async def event_stream(
289
vhost=_AMPQ_VHOST,
290
load_balancer_mode=True,
291
)
292
+ if not await consumer.stream_exists(routing_key):
293
+ msg: str = f"EventStream {uuid} cannot be found"
294
+ _LOGGER.warning(msg)
295
+ raise HTTPException(
296
+ status_code=status.HTTP_404_NOT_FOUND,
297
+ detail=msg,
298
+ )
299
+
300
_LOGGER.info("Consuming %s...", es_id)
301
await _consume(
302
consumer=consumer,
0 commit comments