Instantation

Subscribe here to follow Infinitic's development. Please ⭐️ us on Github!

An Infinitic client lets us start, retry and cancel tasks or workflows, usually from your Web App controllers.

We can instantiate a client from a configuration file in the file system:

import io.infinitic.factory.InfiniticClientFactory;
import io.infinitic.client.InfiniticClient;
...
InfiniticClient client = InfiniticClientFactory.fromConfigFile("infinitic.yml");
import io.infinitic.factory.InfiniticClientFactory
...
val client = InfiniticClientFactory.fromConfigFile("infinitic.yml")

or in the resource folder:

import io.infinitic.factory.InfiniticClientFactory;
import io.infinitic.client.InfiniticClient;
...
InfiniticClient client = InfiniticClientFactory.fromConfigResource("/infinitic.yml");
import io.infinitic.factory.InfiniticClientFactory
...
val client = InfiniticClientFactory.fromConfigResource("/infinitic.yml")

The configuration file should contain:

  • a name (optional)
  • a pulsar entry describing how to connect to Pulsar
infinitic.yml
# name is optional
name: client_name

pulsar: ...

When providing a name, it must be unique among all clients connected to Pulsar, as it will be used as Pulsar producer name.

Edit this page on GitHub Updated at Sun, Jul 3, 2022