chapter three

3 Interacting with Pulsar

 

This chapter covers

  • Running a local instance of Pulsar on your development machine
  • Administering Pulsar with its command-line tools
  • Interacting with Pulsar using the Java client library
  • Troubleshooting Pulsar with its command-line tools

Now that we have covered the overall architecture and terminology of Apache Pulsar, let's start using it. For local development and testing, I recommend running Pulsar inside a Docker container on your own machine, which provides an easy way to get started with Pulsar with a minimal amount of time, effort, and money. For those of you who would prefer to use a full-size Pulsar cluster, you can refer to Appendix A for more details on how to install and run one inside a containerized environment such as Kubernetes.

In this chapter I will walk you through the process of sending and receiving messages programmatically using the Java API, starting with the process of creating a Pulsar namespace and topic using Pulsars administrative tools.

3.1      Getting Started with Pulsar

3.1.1      Administering Pulsar

3.1.2      Pulsar Client

3.2      Pulsar Java Client

3.2.1      Pulsar Client Configuration

3.2.2      Pulsar Producers

3.2.3      Pulsar Consumers

3.2.4      Pulsar Readers

3.3      Advanced Administration

3.3.1      Persistent Topic Metrics

3.3.2      Message Inspection

3.4      Summary