Package
Configuration Methods
From YAML File
From YAML Resource
From Builder
Configuration Properties
Optional name for the client (used for message routing and logging)If not set, a random name will be generated.
Transport configuration (message broker settings)See Transport Configuration
Example YAML Configuration
Pulsar Transport
In-Memory Transport (Testing)
Kotlin Configuration
Using Builder
Using Config Object
Usage Example
Multiple Clients
You can create multiple clients with different configurations:Client Lifecycle
Opening a Client
Closing a Client
Graceful Shutdown
When closing, the client:- Stops accepting new requests
- Waits for ongoing messages to be sent (up to shutdownGracePeriodSeconds)
- Closes transport connections
- Deletes temporary topics
Thread Safety
TheInfiniticClient is thread-safe and can be shared across multiple threads:
Best Practices
- Reuse client instances: Create one client and share it across your application
- Set meaningful names: Use names that identify the client’s purpose
- Configure grace period: Set appropriate shutdown grace period for your workload
- Close properly: Always close clients to release resources
- Handle errors: Wrap client operations in try-catch blocks
- Use connection pooling: Let the transport handle connection pooling
- Monitor client metrics: Track message send rates and failures