class MessageBusUtil {

	public void publishMessage(Message message) {
		LoggingService.logDebug(MODULE_NAME, "Start publish message");
		long timestamp = System.currentTimeMillis();
		StatusReporter.setMessageBusStatus().increasePublishedMessagesPerMicroservice(message.getPublisher());
		message.setId(messageBus.getNextId());
		message.setTimestamp(timestamp);
		
		MessagePublisher publisher = messageBus.getPublisher(message.getPublisher());
		if (publisher != null) {
			try {
				publisher.publish(message);
			} catch (Exception e) {
				LoggingService.logError(MODULE_NAME, "Unable to send message : Message Publisher (" + publisher.getName()+ ")",
						new AgentSystemException(e.getMessage(), e));
			}
		}
		LoggingService.logDebug(MODULE_NAME, "Finishing publish message");
	}

	public  MessageBusUtil();

}