[ https://issues.apache.org/jira/browse/STRATOS-1632?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15031680#comment-15031680 ]
ASF GitHub Bot commented on STRATOS-1632: ----------------------------------------- Github user Thanu commented on a diff in the pull request: https://github.com/apache/stratos/pull/496#discussion_r46133348 --- Diff: components/org.apache.stratos.common/src/test/java/org/apache/stratos/common/test/ThriftStatisticsPublisherTest.java --- @@ -0,0 +1,60 @@ +/* +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you under the Apache License, Version 2.0 (the +* "License"); you may not use this file except in compliance +* with the License. You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, +* software distributed under the License is distributed on an +* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +* KIND, either express or implied. See the License for the +* specific language governing permissions and limitations +* under the License. +*/ + +package org.apache.stratos.common.test; + +import org.apache.stratos.common.statistics.publisher.ThriftClientConfig; +import org.apache.stratos.common.statistics.publisher.ThriftStatisticsPublisher; +import org.junit.Test; +import org.wso2.carbon.databridge.commons.StreamDefinition; + +import java.net.URL; + +import static org.junit.Assert.assertEquals; + +/** + * ThriftStatisticsPublisherTest + */ +public class ThriftStatisticsPublisherTest { + /** + * Checking whether LoadBalancingDataPublisher is created for cep and das according to thrift-client-config.xml + * + * @throws Exception + */ + @Test + public void createLoadBalancingDataPublisher() throws Exception { + URL configFileUrl = ThriftClientConfigParserTest.class.getResource("/thrift-client-config.xml"); + System.setProperty(ThriftClientConfig.THRIFT_CLIENT_CONFIG_FILE_PATH, configFileUrl.getPath()); + + StreamDefinition streamDefinition = new StreamDefinition("Test", "1.0.0"); + --- End diff -- Fixed in commit c7cdaf28b1530f6779c219b57836cf20dc632c5e. > DataPublisher objects are created for nodes which has statsPublisherEnabled > set to false in thrift-client-config.xml > -------------------------------------------------------------------------------------------------------------------- > > Key: STRATOS-1632 > URL: https://issues.apache.org/jira/browse/STRATOS-1632 > Project: Stratos > Issue Type: Bug > Affects Versions: 4.1.4, 4.1.5 > Reporter: Thanuja Uruththirakodeeswaran > > When we have enabled stats publishing for one node and disabled for another > node in thrift-client-config.xml file, Stratos is trying to publish data to > both nodes. This is because when creating load balancing type data publisher, > it is creating DataPublisher for ThriftClientInfo object which has false > value set to statsPublisherEnabled attribute. -- This message was sent by Atlassian JIRA (v6.3.4#6332)