Grouper has a built in messaging system which is not as robust as a messaging middleware product such as ActiveMQ or RabbitMQ.

A message is just a record in a database table which has a timestamp (which determines the ordering), and other fields.

A sender can send to a queue or a topic.  A queue has a receiver pulling messages.  A topic will just distribute to 1 or more queues.

Receivers need to receive the message then mark it as processed when done.

Message table: grouper_message: If using the default internal messaging with Grouper, this is the table that holds the messages and state of messages

See Grouper Messaging System Developers Guide for info on how to integrate the Grouper Messaging System with another messaging system.

GSH to manage built in messaging

GSH to send / receive messages


Setup queues

grouperSession = GrouperSession.startRootSession();

// permissions on objects
GrouperBuiltinMessagingSystem.allowSendToQueue("abc", SubjectTestHelper.SUBJ0);
GrouperBuiltinMessagingSystem.allowReceiveFromQueue("abc", SubjectTestHelper.SUBJ0);
GrouperBuiltinMessagingSystem.disallowSendToQueue("abc", SubjectTestHelper.SUBJ0);
GrouperBuiltinMessagingSystem.disallowReceiveFromQueue("abc", SubjectTestHelper.SUBJ0);


Setup topics

grouperSession = GrouperSession.startRootSession();
// permissions on objects
GrouperBuiltinMessagingSystem.allowSendToTopic("abc", SubjectTestHelper.SUBJ0);
GrouperBuiltinMessagingSystem.disallowSendToTopic("abc", SubjectTestHelper.SUBJ0);
// topics send to queues
GrouperBuiltinMessagingSystem.topicAddSendToQueue("def", "abc");
Collection<String> queues = GrouperBuiltinMessagingSystem.queuesTopicSendsTo("def");
GrouperBuiltinMessagingSystem.topicRemoveSendToQueue("def", "abc");


Message columns

Column nameDescriptionIndexForeign key
 IDdb uuid for this row  
HIBERNATE_VERSION_NUMBERincrementing number so two updates dont occur at once (optimistic locking)  
SENT_TIME_MICROSmicroseconds since 1970 this message was sent (note this is unique for one jvm, this is probably unique across jvms, but not necessarily)  
GET_ATTEMPT_TIME_MILLISmilliseconds that the message was attempted to be received. If the message is not confirmed in a certain amount of time, the state will be set back to IN_QUEUE to try again  
GET_ATTEMPT_COUNThow many times this message has been attempted to be retrieved  
GET_TIME_MILLISmillis since 1970 that this message was successfully received  
FROM_MEMBER_IDmember id of user who sent the message foreign key to
QUEUE_NAMEqueue name for the message that it is delivered to (note, topics can send to multiple queues, which will duplicate the message)  
MESSAGE_BODYmessage body  
ATTEMPT_TIME_EXPIRES_MILLISmillis since 1970 that this attempt will expire before it is acknowledged. After it expires it will be delivered again when receive() is called  

See Also:

Grouper Messaging System

Message Format Detail

Message Format Config Example

Grouper Messaging System Development Guide