Before adding messages into a queue, you must get queue for a context and a scope. MessageQueueRepository is helper class to get queue. Here an example to get queue for customMessage context and application scope :
IQueue applicationQueue = MessageQueueRepository.getQueue("customMessage", MessageQueueRepository.APPLICATION_SCOPE);
public interface IJSONMessage { public JSONObject getJSONMessage(String format) throws JSONException; }