use of org.apache.airavata.model.dbevent.DBEventMessage in project airavata by apache.
the class SharingServiceDBEventMessagingFactory method registerSharingServiceWithPublishers.
/**
* Register sharing service with stated publishers
* @param publishers
* @return
* @throws AiravataException
*/
public static boolean registerSharingServiceWithPublishers(List<String> publishers) throws AiravataException {
for (String publisher : publishers) {
log.info("Sending service discovery message. Publisher : " + publisher + ", Subscriber : " + DBEventService.SHARING.toString());
DBEventSubscriber dbEventSubscriber = new DBEventSubscriber(DBEventService.SHARING.toString());
DBEventMessageContext dbEventMessageContext = new DBEventMessageContext();
dbEventMessageContext.setSubscriber(dbEventSubscriber);
DBEventMessage dbEventMessage = new DBEventMessage(DBEventType.SUBSCRIBER, dbEventMessageContext, publisher);
MessageContext messageContext = new MessageContext(dbEventMessage, MessageType.DB_EVENT, "", "");
getDBEventPublisher().publish(messageContext, DBEventManagerConstants.getRoutingKey(DBEventService.DB_EVENT.toString()));
}
return true;
}
Aggregations