Commit 9dc16e46 authored by Federico Sismondi's avatar Federico Sismondi
Browse files

agent pushed now a bootrapped message to bus

parent 66e48218
...@@ -3,6 +3,7 @@ Plugin to connect to the F-interop backend ...@@ -3,6 +3,7 @@ Plugin to connect to the F-interop backend
""" """
import json import json
import logging import logging
from kombu import Producer
from .base import BaseController, BaseConsumer from .base import BaseController, BaseConsumer
...@@ -40,6 +41,18 @@ class CoreConsumer(BaseConsumer): ...@@ -40,6 +41,18 @@ class CoreConsumer(BaseConsumer):
session=self.session)) session=self.session))
log.info("-------------------------------------------------") log.info("-------------------------------------------------")
# let's send bootstrap message
msg = {
'message': '{component} is up!'.format(component=self.name),
"_type": '{component}.ready'.format(component=self.name)
}
producer = Producer(connection,serializer='json')
producer.publish(msg,
exchange=self.exchange,
routing_key='control.session.bootstrap'
)
def handle_control(self, body, message): def handle_control(self, body, message):
log.debug("DEFAULT HANDLE CONTROL") log.debug("DEFAULT HANDLE CONTROL")
log.debug(("Payload", message.payload)) log.debug(("Payload", message.payload))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment