X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=dmaap-mediator-producer%2FREADME.md;h=7cb1919124e2c9091a349236581d78ae93c74f6a;hb=75123350d6d40767688079d149d26e866ad3d03a;hp=90f8471400f50e5b239055e060a654ad20e26192;hpb=968b89731a192c2ee3f3393d00519879ad89ce56;p=nonrtric.git diff --git a/dmaap-mediator-producer/README.md b/dmaap-mediator-producer/README.md index 90f84714..7cb19191 100644 --- a/dmaap-mediator-producer/README.md +++ b/dmaap-mediator-producer/README.md @@ -8,7 +8,7 @@ The producer takes a number of environment variables, described below, as config >- INFO_PRODUCER_HOST **Required**. The host for the producer. Example: `https://mrproducer` >- INFO_PRODUCER_PORT Optional. The port for the product. Defaults to `8085`. ->- INFO_COORD_ADDR Optional. The address of the Information Coordinator. Defaults to `https://enrichmentservice:8434`. +>- INFO_COORD_ADDR Optional. The address of the Information Coordinator. Defaults to `https://informationservice:8434`. >- DMAAP_MR_ADDR Optional. The address of the DMaaP Message Router. Defaults to `https://message-router.onap:3905`. >- PRODUCER_CERT_PATH Optional. The path to the certificate to use for https. Defaults to `security/producer.crt` >- PRODUCER_KEY_PATH Optional. The path to the key to the certificate to use for https. Defaults to `security/producer.key` @@ -36,21 +36,25 @@ The configured public key and cerificate shall be PEM-encoded. A self signed cer At start up the producer will register the configured job types in ICS and also register itself as a producer supporting these types. If ICS is unavailable, the producer will retry to connect indefinetely. The same goes for MR. -Once the initial registration is done, the producer will constantly poll MR for all configured job types. When receiving messages for a type, it will distribute these messages to all jobs registered for the type. If no jobs for that type are registered, the messages will be discarded. If a consumer is unavailable for distribution, the messages will be discarded for that consumer. +Once the initial registration is done, the producer will constantly poll MR for all configured job types. When receiving messages for a type, it will distribute these messages to all jobs registered for the type. If no jobs for that type are registered, the messages will be discarded. If a consumer is unavailable for distribution, the messages will be discarded for that consumer until it is available again. + +The producer provides a REST API that fulfills the ICS Data producer API, see [Data producer (callbacks)](). The health check method returns the registration status of the producer in ICS as JSON. It also provides a method to control the log level of the producer. The available log levels are the same as the ones used in the configuration above. + + PUT https://mrproducer:8085/admin/log?level= ## Development To make it easy to test during development of the producer, two stubs are provided in the `stub` folder. -One, under the `dmaap` folder, called `dmaap` that stubs MR and respond with an array with one message with `eventSeverity` alternating between `NORMAL` and `CRITICAL`. The default port is `3905`, but this can be overridden by passing a `-port [PORT]` flag when starting the stub. To build and start the stub, do the following: +One, under the `dmaap` folder, called `dmaap` that stubs MR and respond with an array with one message with `eventSeverity` alternating between `NORMAL` and `CRITICAL`. The default port is `3905`, but this can be overridden by passing a `-port ` flag when starting the stub. To build and start the stub, do the following: >1. cd stub/dmaap >2. go build ->3. ./dmaap +>3. ./dmaap [-port \] -One, under the `consumer` folder, called `consumer` that at startup will register a job of type `STD_Fault_Messages` in ICS, and then listen for REST calls and print the body of them. By default, it listens to the port `40935`, but his can be overridden by passing a `-port [PORT]` flag when starting the stub. To build and start the stub, do the following: +One, under the `consumer` folder, called `consumer` that at startup will register a job of type `STD_Fault_Messages` in ICS, and then listen for REST calls and print the body of them. By default, it listens to the port `40935`, but his can be overridden by passing a `-port ` flag when starting the stub. To build and start the stub, do the following: >1. cd stub/consumer >2. go build ->3. ./consumer +>3. ./consumer [-port \] Mocks needed for unit tests have been generated using `github.com/stretchr/testify/mock` and are checked in under the `mocks` folder. **Note!** Keep in mind that if any of the mocked interfaces change, a new mock for that interface must be generated and checked in.