Class ReplicatedMessageQueueAgent

    • Field Detail

      • id

        protected java.lang.String id
        The service id
      • searchinterval

        protected java.lang.Integer searchinterval
        The search interval argument.
    • Constructor Detail

      • ReplicatedMessageQueueAgent

        public ReplicatedMessageQueueAgent()
    • Method Detail

      • agentCreated

        public void agentCreated()
        Called on agent creation.
      • agentBody

        public void agentBody()
      • subscribeForReplication

        public ISubscriptionIntermediateFuture<Event> subscribeForReplication​(java.lang.String topic)
        Subscribe to a specific topic. New events that fit to the topic are forwarded to all replication subscribers as intermediate results. A subscribe can unsubscribe by terminating the future.
        Specified by:
        subscribeForReplication in interface IMessageQueueReplicationService
        Parameters:
        topic - The topic.
        Returns:
        The events.
      • subscribe

        public ISubscriptionIntermediateFuture<Event> subscribe​(java.lang.String topic)
        Subscribe to a specific topic. New events that fit to the topic are forwarded to all subscribers as intermediate results. A subscribe can unsubscribe by terminating the future. Every time when someone subscribe for local messages the server also subscribe for the given topic by all the other remote services.
        Specified by:
        subscribe in interface IMessageQueueService
        Parameters:
        topic - The topic.
        Returns:
        The events.
      • publish

        public IFuture<java.lang.Void> publish​(java.lang.String topic,
                                               Event event,
                                               java.lang.Boolean replicate)
        Publish a new event to the queue.
        Specified by:
        publish in interface IMessageQueueReplicableService
        Parameters:
        topic - The topic.
        event - The event to publish.
        replicate - Should the event be replicated among all message queues?
      • publish

        public IFuture<java.lang.Void> publish​(java.lang.String topic,
                                               Event event)
        Publish a new event to the queue.
        Specified by:
        publish in interface IMessageQueueService
        Parameters:
        topic - The topic.
        event - The event to publish.