Add test environment with 2 brokers
API changes and refactoring