Now let’s move on to the implementation of our Publisher flow. Let’s imagine that some service collects news from some resources and transmits the data within our Topic template to the flow via Webhook. After that, we put the Pub-Sub component in Publisher mode and configure it as follows: specify the Topic we created earlier, then in the mapping tab based on our JSON schema we will need to specify the contents of the fields of this schema.
Also, prepare our Subscribers. For the example, we will use three flows, each of which will perform a specific function.
The first flow takes some fields from the received message and does an E-mail to the required addresses.
The second flow writes the necessary information in Google Spreadsheets.
The third flow is a prototype of the database, which should store all the data obtained. For a simpler implementation, a CSV document was chosen, which is stored on a remote FTP Server.
By sending a request to Webhook in the Publisher thread we start three flows at once.
As a result, we will get:
As a result, the PubSub component is a powerful tool to perform any number of asynchronously performed tasks on a specified data template, with the ability to select specific data from Topic and further manipulate them, which simplifies the work and increases the speed of tasks of various types.
Click here to learn more about the elastic.io iPaaS