You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Next »

 Grouper messaging system is a Java implementation of the Interface GrouperMessaginSystem.  It allows messages to be sent and received from a messaging system.  The built in implementations are:

  • Grouper database (default)
  • Amazon AWS SNS/SQS/dynamo DB
  • ActiveMQ

The messages must:

  • support 100kB in size
  • support ordered messaging
  • there are bulk methods, but the implementation can do them one at a time (if there is an error, block until all are successful)

The GrouperMessagingSystem interface is located in the GrouperClient:

/**
 *
 * @author mchyzer
 */
package edu.internet2.middleware.grouperClient.messaging;

import java.util.Collection;


/**
 * Represents the methods that a messaging system
 * needs to support
 */
public interface GrouperMessagingSystem {

  /**
   * send a message to a queue name.  Note, the recipient could be a
   * queue or a topic (generally always one or the other) based on the
   * implementation of the messaging system.  Messages must be delievered
   * in the order that collection iterator designates.  If there is a problem
   * delivering the messages, the implementation should log, wait (back off)
   * and retry until it is successful.
   * @param messages
   */
  public void sendMessages(Collection<GrouperMessage> messages);

  /**
   * tell the messaging system that these messages are processed
   * generally the message system will use the message id.  Note, the objects
   * sent to this method must be the same that were received in the
   * receiveMessages method.  If there is a problem
   * delivering the messages, the implementation should wait (back off)
   * and retry until it is successful.
   * @param messages
   */
  public void messagesAreProcessed(Collection<GrouperMessage> messages);

  /**
   * this will generally block until there are messages to process.  These messages
   * are ordered in the order that they were sent.
   * @return a message or multiple messages.  It will block until there are messages
   * available for this recipient to process
   */
  public Collection<GrouperMessage> receiveMessages();

}

This is the interface for GrouperMessage (located in the GrouperClient), which has a default implementation that can be used.  Note the message contents will be encrypted, have metadata, etc.

/**
 * @author mchyzer
 * $Id$
 */
package edu.internet2.middleware.grouperClient.messaging;


/**
 * grouper message sent to/from grouper messaging systems
 */
public interface GrouperMessage {


  TODO add timestamp sent

  /**
   * @return the from
   */
  public String getFrom();
 
  /**
   * @param from1 the from to set
   */
  public void setFrom(String from1);
 
  /**
   * @return the id
   */
  public String getId();
 
  /**
   * @param id1 the id to set
   */
  public void setId(String id1);
 
  /**
   * @return the message
   */
  public String getMessage();
 
  /**
   * @param message1 the message to set
   */
  public void setMessage(String message1);

}

sdf

  • No labels