Skip to content

Commit

Permalink
updates from diamond queues
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanmcreynolds committed Mar 13, 2024
1 parent cf58c5d commit 265c07e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export TILED_INGEST_TILED_CONFIG_PATH=/dls/tmp/mlex/mlex_tomo_framework/tiled_conda/deploy/config
export STOMP_SERVER=k11-control
export STOMP_TOPIC_NAME=/topic/org.dawnsci.file.topic
11 changes: 4 additions & 7 deletions src/tiled_ingestor/activemq/consumer.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@

import stomp

from .schemas import DIAMOND_FILEPATH_KEY, DIAMOND_STATUS_KEY, STOMP_TOPIC_NAME
from .schemas import DIAMOND_FILEPATH_KEY, DIAMOND_STATUS_KEY
from ..ingest import get_tiled_config, process_file
import logging

TILED_INGEST_TILED_CONFIG_PATH = os.getenv("TILED_INGEST_TILED_CONFIG_PATH")
STOMP_SERVER = os.getenv("STOMP_SERVER")
STOMP_LOG_LEVEL = os.getenv("STOMP_LOG_LEVEL", "INFO")
STOMP_TOPIC_NAME = os.getenv("STOMP_TOPIC_NAME", "INFO")

logging.getLogger("stomp").setLevel(logging.getLevelName(STOMP_LOG_LEVEL))
logging.getLogger("asyncio").setLevel(logging.INFO)
Expand All @@ -38,12 +39,8 @@ def on_message(self, message):
# separate parameters. But in the version I'm using, the message
# is an object that contains body and headers
ob = json.loads(message.body)
logger.info(f"Received message: {ob['status']}")
# if (ob["status"] == "STARTED"):
if ob[DIAMOND_STATUS_KEY] == "COMPLETE":
print(ob)
self.messages.append(ob[DIAMOND_FILEPATH_KEY])

logger.info(f"Received message: {ob}")
self.messages.append(ob['filePath'])

def start_consumer():
tiled_config = get_tiled_config(TILED_INGEST_TILED_CONFIG_PATH)
Expand Down

0 comments on commit 265c07e

Please sign in to comment.