public int sendMessage(int priority, int receiver, int context, String content, int queue) {
		
		int status = -1;
		
		if (messageBroker == null) {
			log.error("There is no broker connecting to server");
		} else {
			if (messageSenderBroker == null) {
				messageSenderBroker = messageBroker.createMessageSender();
			}
			
			Message msg = messageBroker.createMessage(priority, receiver, context, content);
			
			try {
				status = messageSenderBroker.send(msg, queue);
				if (status < 0) {
					log.error("Send message failed with status " + status);
				}
			} catch (ServerConnectionException e) {
				log.error("No connection to server", e);
			} catch (InvalidAuthenticationException e) {
				log.error("Client not authenticated", e);
			} catch (WrongResponseException e) {
				log.error("Received wrong response from server.", e);
			} catch (SendMessageException e) {
				log.error("Could not send command to server.", e);
			}
		}
		
		return status;
	}