1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2022 Nordix
5 .. |nbsp| unicode:: 0xA0
8 .. |nbh| unicode:: 0x2011
11 .. |yaml-icon| image:: ./images/yaml_logo.png
14 ========================
15 Kafka Message Dispatcher
16 ========================
21 The O-RAN SC Kafka Message Dispatcher is a specific implementation of an A1 Simulator ref:`calloutserver`, which further redirects A1 Policy operations to a Kafka message topic, to be consumed by an external function.
23 A1 Policy are redirected as Kafka messages to a configured Kafka Topic to an external receiver, then responses from the external receiver are collected from another configured Kafka Topic. This provides a Kafka-based request-response abstraction for adding supplemental simulator behavior for particular A1 Policy Types. After a request message is sent, a response message will be expected within some configurable timeout interval (default: 30 sec). The topics to be used for particular A1 Policy Types is configured using a JSON map (Example: `policytype_to_topicmap.json <../near-rt-ric-simulator/test/KAFKA_DISPATCHER/resources/policytype_to_topicmap.json>`
25 **Note:** As with other A1 Simulator call-out servers, the Kafka message dispatcher functionality is only available for *'STD_2.0.0'* version simulators.
27 The Kafka message dispatcher exposes a 'Kafka Message Dispatcher' REST API. This internal API is invoked directly by the A1 Simulator, and is not intended to be used by any other client. This API is documented in `Kafka Message Dispatcher API <./KAFKA_DISPATCHER_api.html>`_ and in OpenAPI YAML format:
30 :header: "API name", "|yaml-icon|"
33 "Kafka Message Dispatcher API", ":download:`link <../near-rt-ric-simulator/test/KAFKA_DISPATCHER/api/KAFKA_DISPATCHER_api.yaml>`"
35 The Kafka message dispatcher also exposes an 'Admin API' to manipulate the behavior of the Kafka message dispather itself. The 'Kafka Message Dispatcher Admin API' is documented below:
46 Returns the status of the Kafka Message Dispatcher.
62 curl -X GET "http://localhost:7075/"
73 It is possible to manipulate the response of all operations on the Kafka Message Dispatcher module
78 Force a specific response code for the all (the next) Kafka Message Dispatcher module operations. Unless it is reset, it will always respond the same response code back.
82 /dispatcheradmin/forceresponse?code=<http-response-code>
88 The HTTP response code to return.
94 Force response code: <expected code> set for all all dispatcher response until it is resetted
100 curl -X POST "http://localhost:7075/dispatcheradmin/forceresponse?code=500"
106 Force response code: 500 set for all dispatcher response until it is resetted
109 Reset response-manipulation
110 ---------------------------
111 It is possible to reset the response manipulation on the Kafka Message Dispatcher module
116 Clears specific response code for all (the next) Kafka Message Dispatcher module operation.
120 /dispatcheradmin/forceresponse
126 The HTTP response code to return.
132 Force response code has been resetted for dispatcher responses
138 curl -X POST "http://localhost:7075/dispatcheradmin/forceresponse"
144 Force response code has been resetted for dispatcher responses
147 Response time manipulation
148 --------------------------
149 It is possible to set a period of time to delay response time.
154 Force delayed response of all dispatcher responses. The setting will remain until the delay is cleared.
158 /dispatcheradmin/forcedelay?delay=<delay-time-seconds>
164 The time in seconds to delay all responses.
170 Force delay: <expected_delay> sec set for all dispatcher responses until it is resetted
176 curl -X POST "http://localhost:7075/dispatcheradmin/forcedelay?delay=5"
182 Force delay: 5 sec set for all dispatcher responses until it is resetted
185 Reset response time manipulation
186 --------------------------------
187 It is also possible to reset delay response time.
192 The setting will clear the delay.
196 /dispatcheradmin/forcedelay
202 The time in seconds to delay all responses.
208 Force delay has been resetted for all dispatcher responses
214 curl -X POST "http://localhost:7075/dispatcheradmin/forcedelay"
220 Force delay has been resetted for all dispatcher responses