Overview
Pulsar acts as the backbone for all communication in Infinitic:- Task dispatching and execution
- Workflow state transitions
- Event notifications
- Worker coordination
transport.pulsar section.
Basic Configuration
Here’s a minimal Pulsar configuration for local development:Required Parameters
Pulsar broker service URL. Must start with
pulsar:// or pulsar+ssl://.Example: pulsar://localhost:6650/Pulsar HTTP admin service URL. Must start with
http:// or https://.Example: http://localhost:8080Pulsar tenant name. Cannot be blank.Example:
infiniticPulsar namespace within the tenant. Cannot be blank.Example:
productionClient Configuration
Configure the Pulsar client connection behavior:Key Client Parameters
Number of threads for handling connections to brokers.Default: Pulsar client default (1 thread per core)
Number of threads for message listeners.Default: Pulsar client default
Number of connections established per broker.Default: 1
Timeout for producer/consumer operations in seconds.Default: 30
Timeout for establishing broker connections in seconds.Default: 10
Maximum memory used by the client in megabytes.Default: 64 MB
Consumer Configuration
Configure message consumption behavior:Consumer Parameters
Size of the consumer receive queue. Higher values increase throughput but use more memory.Default: 1000
Timeout for message acknowledgment in seconds.Default: 0 (disabled)
Delay before redelivering negatively acknowledged messages.Default: 60 seconds
Maximum number of times a message will be redelivered before being sent to dead letter queue.Default: 3
Producer Configuration
Configure message production behavior:Producer Parameters
Timeout for send operations in seconds.Default: 30
Whether to block send operations when the producer queue is full.Default: true
Enable message batching for better throughput.Default: true
Compression algorithm for messages. Options:
NONE, LZ4, ZLIB, ZSTD, SNAPPY.Default: NONEAuthentication
Token Authentication
Use JWT tokens for authentication:OAuth2 Authentication
For OAuth2 authentication (e.g., with Auth0, Okta):TLS/SSL Configuration
Enable secure connections:TLS Parameters
Path to trusted CA certificates file.
Path to client private key file.
Path to client certificate file.
Enable hostname verification for TLS connections.Default: false
Allow insecure TLS connections (useful for testing).Default: false
Pulsar Policies
Configure namespace policies for topics:Time-to-live for messages in seconds (24 hours in example).
Retention time for acknowledged messages in minutes (7 days in example).
Maximum retention size in megabytes.
Production Configuration Example
Complete production-ready configuration:Configuration via Code
You can also configure Pulsar programmatically:Troubleshooting
Connection Issues
If you’re experiencing connection problems:- Verify broker URLs are correct and accessible
- Check firewall rules allow connections to Pulsar ports
- Verify authentication credentials are valid
- Check TLS certificates are not expired
Performance Tuning
For high-throughput scenarios:- Increase
ioThreadsandconnectionsPerBroker - Enable producer batching with appropriate batch sizes
- Use compression (LZ4 or ZSTD) for large messages
- Increase
memoryLimitMBif memory permits - Tune
receiverQueueSizebased on message size and rate
Message Redelivery
If messages are being redelivered excessively:- Increase
ackTimeoutSecondsfor long-running tasks - Adjust
negativeAckRedeliveryDelaySecondsto give tasks more time - Check worker health and processing capacity
- Review
maxRedeliverCountsetting
Best Practices
- Use SSL/TLS in production - Always encrypt traffic with
pulsar+ssl:// - Enable authentication - Use token or OAuth2 authentication
- Monitor memory usage - Set appropriate
memoryLimitMBlimits - Use separate namespaces - Isolate environments (dev, staging, production)
- Configure dead letter queues - Set
maxRedeliverCountappropriately - Enable compression - Use ZSTD for best compression ratio
- Tune for your workload - Adjust batch sizes and queue sizes based on message patterns
Next Steps
- Storage Backends - Configure persistent storage
- Deployment - Deploy Infinitic to production