Patent ID: 8095598

Claim:
A method for processing messages in an enterprise messaging system, the method comprising: receiving, by a messaging engine, a plurality of messages from at least one publisher via at least one receiving thread; based on a determination that at least one of a size of a message of the plurality of messages is greater than a first predetermined threshold and an amount of storage space in a repository in the messaging engine is below a second predetermined threshold, storing a first portion of the message in the repository and a second portion of the message in a database; based on a determination that the size of the message of the plurality of messages is less than the first predetermined threshold and the amount of storage space in the repository in the messaging engine is below the second predetermined threshold, storing the message in the repository, the plurality of messages associated with a topic for subscription, the plurality of messages including a particular message published via a connection created for a publisher, the particular message including a collection of subscriber identifications (IDs) identifying one or more subscribers sharing the connection to subscribe the topic when the particular message is published from the publisher; generating, in response to a plurality of connections created for a subscriber associated with a subscriber ID, a plurality of subscription sessions for the subscriber subscribing the topic, each subscription session being associated with one of the plurality of connections; maintaining a plurality of delivery policies of the plurality of subscription sessions, at least one policy being different from a remainder of the delivery policies, each subscription session being associated with one of the plurality of delivery policies including one or more attributes; delivering the particular message to the subscriber via the plurality of subscription sessions if the particular message is not prevented from being delivered to the subscriber; and preventing the particular message from being delivered to the subscriber if the subscription ID is included in the collection of subscription IDs of the particular message and if a no-local delivery attribute specific to the subscriber and a particular subscription session is set, the no-local delivery attribute specifying that the subscriber does not want to receive messages of the plurality of messages that are published via the connection shared with the publisher.