Skip to main content

CLI that help developers to publish messages into any pulsar topic in order to test features (usually, consumers) that relies on a pulsar consumer

Project description

Pulsar Producer

CLI that allows to send a message into a Apache Pulsar topic

Usually, implementing an Apache Pulsar Consumers, you will need to test it before release. Then, it's quite painful that you need to write or change some code in order to test it. Having that said, I have implemented this CLI that can help you with that.

Now, you can have a file with the message you want to send into a specific Apache Pulsar Topic and simply test your Apache Pulsar Consumer easily.

How to use it

First, you should install the CLI on your machine

pip install pulsar-producer or pip install --user pulsar-producer if you want make it available only for your user.

NOTE: This package still not publish on pypi, only on testing environment

NOTE: pip install -i https://test.pypi.org/simple/ pulsar-producer==0.1.0

Then, you need to have an file with your Apache Pulsar server address. This file SHOULD follow a JSON format.

Example:

my-apache-pulsar-configuration.json

{
        "host": "localhost",
        "port": "6650",
        "topic": "my-topic-name"
}

Then, you need to have another file with contains the message you want to publish in your Apache Pulsar topic in order to test your Apache Pulsar Consumer. This file can contains ANYTHING you want. In this example, let's say you want to publish a JSON structure message.

my-message-file-example.json

{
    "KEY": "THIS IS MY MESSAGE WHICH COULD BE ONLY PURE TEXT (NOT JSON)"
}

Now, you just need to run:

pulsar-producer --pulsar-connection-file ./path-of-your-my-apache-pulsar-configuration-example-json --message-file ./path-or-your-message-file

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pulsar_producer-0.1.0.tar.gz (2.9 kB view hashes)

Uploaded Source

Built Distribution

pulsar_producer-0.1.0-py3-none-any.whl (3.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page