We have learned how to create a client synchronously, create a producer synchronously, and publish a message to the cluster synchronously.
For the rest of the course, we will be working mostly with asynchronous code. We will also be using some helper classes for repeated code. In the following video we will learn about:
AsyncRunner.java to help us with boilerplate asynchronous code
PulsarClientFactory.java for connecting to the cluster
MessageGenerator.java for creating test messages for our e-commerce application
The following Java files are used throughout the rest of the course to help us write our application:
PulsarClientFactory.java:
handles creating the client
be sure to update the path to your credentials file
MessageGenerator.java:
create String or other message types to publish to the server
AsyncRunner.java:
creates an asynchronous framework for our application
the PulsarClient is automatically created for us by the run() method
we must write the abstract setup(PulsarClient client) and abstract workLoop()