Usage#
This guide will go over the basic usage for kobolds. These concepts will be demonstrated using the CLI but apply to all clients and brokers.
Examples#
Examples for clients are hosted in the Codex repository. I am attempting to keep these examples as up to date as possible but please note that they may lag behind a little. However, this document will runn you through the basic client usage examples for how to get started with Kobolds.
Starting the broker#
This guide assumes you've installed kobolds and it is available in your PATH variable. Start listening using the default configuration
Press ctrl + c to stop listening.
Under the hood, this is what is happening
Connecting to the broker#
Connecting to the broker is the best first step to validate that you have the correct credentials and the protocols match.
Press ctrl + c to stop the connection.
Pubsub: Creating a topic#
As of now, you must create a topic before the router will route messages from publishers or to subscribers. This command takes several optional arguments. Please note that not all features related to topic configuration are implemented.
NOTE: all topic names must begin with a
/character.
Pubsub: Publishing a message to a topic#
As of now, there must be a topic created before the router will route published messages to subscribers. See Creating a Topic
NOTE: all topic names must begin with a
/character. The subscribe command will not output the body of the published message (yet). try passing the--traceflag to your publish command to see the subscriber print the time it took to receive the message.
# publish a single message with the body "world"
kobolds publish /pubsub-test --body "world" --config-file <path/to/client/config/file>
# or if you'd like to try something fun
kobolds publish /pubsub-test --count 1000000 --config-file <path/to/client/config/file>
Pubsub: Subscribing to a topic#
As of now, there must be a topic created before the router will route published messages to subscribers. See Creating a Topic
NOTE: all topic names must begin with a
/character.
Reqrep: Creating a service#
As of now, you must create a service before the router will route messages from requestors or to repliers and vice-versa. This command takes several optional arguments. Please note that not all features related to service configuration are implemented.
NOTE: all service names must begin with a
/character.
Reqrep: Sending a request to a service#
As of now, there must be a service created before the router will route requests to repliers. See Creating a Service. Requests do not currently support patterns for service names.
NOTE: all service names must begin with a
/character.
Reqrep: Replying to a service request#
As of now, there must be a service created before the router will route requests to repliers. See Creating a Service. Replies do not currently support patterns for service names.
NOTE: all service names must begin with a
/character.