- private DmaapMessageHandler getDmaapMessageHandler() throws IOException {
- String agentBaseUrl = "https://localhost:" + this.localServerPort;
- AsyncRestClient agentClient = createRestClient(agentBaseUrl);
- Properties dmaapPublisherProperties = applicationConfig.getDmaapPublisherConfig();
- MRBatchingPublisher producer = getMessageRouterPublisher(dmaapPublisherProperties);
-
- return createDmaapMessageHandler(agentClient, producer);
+ protected DmaapMessageHandler getDmaapMessageHandler() {
+ if (this.dmaapMessageHandler == null) {
+ String agentBaseUrl = "http://localhost:" + this.localServerHttpPort;
+ AsyncRestClient agentClient =
+ new AsyncRestClient(agentBaseUrl, this.applicationConfig.getWebClientConfig());
+ AsyncRestClient producer = new AsyncRestClient(this.applicationConfig.getDmaapProducerTopicUrl(),
+ this.applicationConfig.getWebClientConfig());
+ this.dmaapMessageHandler = new DmaapMessageHandler(producer, agentClient);
+ }
+ return this.dmaapMessageHandler;