Exchanges are magic
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2021-08-17 18:05:32 +02:00
parent 2c0e6ec7d7
commit a118b79512
3 changed files with 24 additions and 9 deletions

View File

@@ -62,8 +62,8 @@ class SampleResource(Resource):
break
with opentracing.tracer.start_active_span('publishMetaMessage'):
try: # TODO change exchange
magic_amqp.publish(
try:
magic_amqp.publish_meta(
{
'tag': generated_tag,
'timestamp': datetime.now().isoformat(),
@@ -84,8 +84,11 @@ class SampleResource(Resource):
# Announce only after the data is successfully committed
with opentracing.tracer.start_active_span('publishInCacheMessage'):
try: # TODO change exchange
magic_amqp.publish({'tag': generated_tag})
try:
magic_amqp.publish_cache({
'tag': generated_tag,
'mime_type': soundfile.mimetype
})
except Exception as e:
current_app.logger.exception(e)
return abort(500, f"AMQP Publish error: {str(e)}")