Skip to content

Commit 7bda179

Browse files
authored
Merge pull request #63 from AxonIQ/topology-changes
Add operation for clients to subscribe to topology changes in control…
2 parents 3e7e51e + 394b314 commit 7bda179

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

src/main/proto/control.proto

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,28 @@ message PlatformInboundInstruction {
4343

4444
/* The result of the execution of an instruction */
4545
InstructionResult result = 6;
46+
47+
/* Subscribe to topology changes in the AxonServer cluster.
48+
This allows the client to receive updates about changes in the cluster, such as handler additions or removals.
49+
*/
50+
SubscribeTopologyChanges subscribe_topology_changes = 7;
51+
52+
/* Unsubscribe from topology changes in the AxonServer cluster. */
53+
UnsubscribeTopologyChanges unsubscribe_topology_changes = 8;
4654
}
4755

4856
/* Instruction identifier. If this identifier is set, this instruction will be acknowledged via outbound stream */
4957
string instruction_id = 5;
5058
}
5159

60+
/* Message to subscribe to topology changes within the control channel's context */
61+
message SubscribeTopologyChanges {
62+
}
63+
64+
/* Message to unsubscribe from topology changes within the control channel's context */
65+
message UnsubscribeTopologyChanges {
66+
}
67+
5268
/* An instruction or information from the AxonServer Platform to the Application Node */
5369
message PlatformOutboundInstruction {
5470

@@ -87,6 +103,11 @@ message PlatformOutboundInstruction {
87103

88104
/* Acknowledgement of previously sent instruction via inbound stream */
89105
InstructionAck ack = 11;
106+
107+
/* Notification of a change in the topology of the AxonServer cluster.
108+
This is used to inform clients about changes in the cluster, such as handler additions or removals.
109+
*/
110+
TopologyChange topology_change = 13;
90111
}
91112

92113
/* Instruction identifier. If this identifier is set, this instruction will be acknowledged via inbound stream */
@@ -223,4 +244,33 @@ message EventProcessorSegmentReference {
223244
}
224245

225246
message Heartbeat {
247+
}
248+
249+
message TopologyChange {
250+
UpdateType update_type = 1;
251+
string context = 2;
252+
string client_id = 3; // The client ID of the component requesting the update
253+
string client_stream_id = 4; // The client ID of the component requesting the update
254+
string component_name = 5; // The name of the component requesting the update
255+
oneof subscription {
256+
CommandSubscription command = 6; // The subscription ID to add or remove
257+
QuerySubscription query = 7; // The processor name to add or remove
258+
}
259+
}
260+
261+
message CommandSubscription {
262+
string name = 1; // The subscription ID to add or remove
263+
int32 load_factor = 2; // The load factor for the subscription
264+
}
265+
266+
message QuerySubscription {
267+
string name = 1; // The subscription ID to add or remove
268+
}
269+
270+
enum UpdateType {
271+
ADD_COMMAND_HANDLER = 0; // a new command handler has been added
272+
REMOVE_COMMAND_HANDLER = 1; // a command handler has been removed
273+
ADD_QUERY_HANDLER = 2; // a new query handler has been added
274+
REMOVE_QUERY_HANDLER = 3; // a query handler has been removed
275+
RESET_ALL = 4; // reset all information in the client, new information will be sent
226276
}

0 commit comments

Comments
 (0)