Assure1 Pulsar Tester microservice¶
Overview¶
The Assure1 Pulsar Tester microservice is part of the microservice suite. The Pulsar Tester was created to help operators/developers debug and test pulsar-related workflow pipelines.
Prerequisites¶
-
A microservices cluster must be setup. Refer to Microservice Cluster Setup.
-
Apache Pulsar must be installed. Refer to Apache Pulsar microservice.
-
Default OS Curl package installed
Setup¶
su - assure1
export NAMESPACE=a1-zone1-pri
export WEBFQDN=<Primary Presentation Web FQDN>
a1helm install pulsar-tester assure1/pulsar-tester -n $NAMESPACE --set global.imageRegistry=$WEBFQDN
Default Configuration¶
Name | Value | Possible Values | Notes |
---|---|---|---|
LOG_LEVEL | INFO | FATAL, ERROR, WARN, INFO, DEBUG | Logging level used by application. |
PORT | 30001 | int 0-65535 | Default service port, MUST BE >= 30000 |
Configurations can be changed by passing the values to the a1helm install
prefixed with the configData parent key.
To change the pulasr-tester default port during installation pass following argument during a1helm install
replacing number 30002
with your custom port:
--set-string configData.PORT=30002
Example of setting the log level to DEBUG¶
a1helm install ... --set configData.LOG_LEVEL=DEBUG
Service status¶
Once installed, the pulsar-microservice will run a REST API on local port 30001, which (unless forwarded by the firewall) should only be accessible from a local instance (for security purposes). The service will allow the operator to send a pulsar message to any of the main available topic namespaces (event/metric/graph) and any selected topic in that namespace. To make sure the service is running:
curl localhost:30001/status
To get help:
curl localhost:30001/help
Sending data¶
The following are examples of publishing a "test message" to a "test" topic with cur
Inline:
curl -X POST -d "Test Message" localhost:30001/publish/assure1/event/test
curl -X POST -d@testFile.json localhost:30001/publish/assure1/event/test
Subscribing to topic¶
To subscribe to a topic, simply access the subscribe endpoint followed by a tenant/namespace and topic.
The following is an example of subscribing to a "test" topic in an event namespace:
curl localhost:30001/subscribe/assure1/event/test
Displaying data¶
To view the subscription output (logs) just view the logs for the microservice:
a1k logs <full-pod-name> -n a1-zone1-pri