Topic based loop detection in a publish/subscribe network
AssigneeInternational Business Machines Corporation
InventorsAndrew D. Banks, Gavin Beardall, Adrian D. Dick, Ian C. Vanstone
Life of this patent
Estimating the term…
Abstract
When a new broker is connected to a network, a loop detection message is sent over the new connection created by the new broker. The loop detection message includes topics. At each receiving broker, topics that cannot be propagated to a neighbor broker are removed. If the loop detect message contains no topics, the loop detect message is not propagated further. If the loop detection message returns to the new broker, a loop is detected.
Claims18
A method for detecting a loop in a publish/subscribe network, the publish/subscribe network having at least one broker, comprising:
- connecting a new broker to the publish/subscribe network by creating a first new connection between the new broker and a parent broker and a second new connection between the new broker and a neighbor broker of the new broker in the publish/subscribe network, the new broker from which the first new connection is made, the parent broker to which the first new connection is made;
- creating a loop detection message at the new broker, the loop detection message comprising information representing the new broker, the parent broker, all topics which are published at the new broker over the new connections;
- sending the loop detection message from the new broker to the parent broker over the first new connection or to the neighbor broker of the new broker over the second new connection, the parent broker or the neighbor broker of the new broker forwarding the loop detection message to a receiving broker of the publish/subscribe network;
- upon receiving the loop detection message at the receiving broker, checking if the receiving broker is the new broker from which the loop detection message is originated;
- if the receiving broker is not the new broker, removing topics in the loop detection message, the removed topics that are not registered to a neighbor broker of the receiving broker, and forwarding the loop detection message having the removed topics that are not registered to the neighbor broker of the receiving broker, to the neighbor broker of the receiving broker;
- repeating the checking, the removing, and forwarding the loop detection message having the removed topics until no topics remain in the loop detection message if the receiving broker is not determined as the new broker;
- if the receiving broker is the new broker, deciding that a loop is created by the new connections;
- and
- upon deciding that the loop is created by the new connections, canceling the new connections in order to prevent publications from entering the loop.
A system for detecting a loop in a publish/subscribe network, the publish/subscribe network having at least one broker, comprising:
- a memory device;
- a processor device connected to the memory device,
- wherein the processor device is configured to:
- connect a new broker to the publish/subscribe network by creating a first new connection between the new broker and a parent broker and a second new connection between the new broker and a neighbor broker of the new broker in the publish/subscribe network, the new broker from which the first new connection is made, the parent broker to which the first new connection is made;
- create a loop detection message at the new broker, the loop detection message comprising information representing the new broker, the parent broker, all topics which are published at the new broker over the new connections;
- send the loop detection message from the new broker to the parent broker over the first new connection or to the neighbor broker of the new broker over the second new connection, the parent broker or the neighbor broker of the new broker forwarding the loop detection message to a receiving broker;
- check if the receiving broker is the new broker from which the loop detection message is originated;
- remove topics in the loop detection message, the removed topics that are not registered to a neighbor broker of the receiving broker when the receiving broker is not determined as the new broker;
- forward the loop detection message having the removed topics that cannot be propagated are not registered to the neighbor broker, to the neighbor broker from the receiving broker;
- repeat the checking, the removing and forwarding the loop detection message having the removed topics until no topics remain in the loop detection message if the receiving broker is not determined as the new broker;
- decide that a loop is created by the new connections when the receiving broker is the new broker;
- and
- cancel the new connections when the loop is created in order to prevent publications from entering the loop.
Dependencies are inferred from the claim text.