Package com.tnsai.protocols.annotations
Annotation Interface Broadcast
Enables broadcast messaging for an Agent or Role.
Agent can send messages to all subscribers of a topic.
Internal Mode:
@Broadcast(topic = "updates")
public class PublisherAgent extends Agent {
// Broadcasts to all internal subscribers
}
Remote Mode:
@Broadcast(topic = "updates", broker = "http://broker:9090")
public class RemotePublisher extends Agent {
// Broadcasts via remote message broker
}
-
Required Element Summary
Required Elements -
Optional Element Summary
Optional ElementsModifier and TypeOptional ElementDescriptionRemote message broker URL.booleanWhether this agent can publish to the topic.booleanWhether this agent can subscribe to the topic.Transport mode.
-
Element Details
-
topic
String topicBroadcast topic/channel name. -
broker
String brokerRemote message broker URL. If empty, uses internal broker.- Default:
""
-
transport
TransportMode transportTransport mode.- Default:
AUTO
-
canPublish
boolean canPublishWhether this agent can publish to the topic.- Default:
true
-
canSubscribe
boolean canSubscribeWhether this agent can subscribe to the topic.- Default:
true
-