vladmihalcea / flexy-pool

FlexyPool adds metrics and failover strategies to a given Connection Pool, allowing it to resize on demand.
Apache License 2.0
1.09k stars 120 forks source link

Flexypool not showing any stats #50

Closed asker2410 closed 6 years ago

asker2410 commented 6 years ago

Hi, I have added flexypool into my applicaiton but when I observe the MBeans on Jconsole , it doesn't show any activity.

Here is what I did: In pom added below entry:

<dependency>
   <groupId>com.vladmihalcea.flexy-pool</groupId>
    <artifactId>flexy-dbcp</artifactId>
    <version>1.3.0</version>
    <exclusions>
        <exclusion>
            <groupId>com.vladmihalcea.flexy-pool</groupId>
            <artifactId>flexy-dropwizard-metrics</artifactId>
        </exclusion>
    </exclusions>
</dependency>

In ApplicationContext.xml added below entries:

<bean id="configurationBuilder" class="com.vladmihalcea.flexypool.config.Configuration$Builder">
    <constructor-arg value="uniqueId"/>
    <constructor-arg ref="oracleDataSource"/>
    <constructor-arg value="#{ T(com.vladmihalcea.flexypool.adaptor.DBCPPoolAdapter).FACTORY }"/>
</bean>

<bean id="configuration" factory-bean="configurationBuilder" factory-method="build"/>

<bean id="dataSource" class="com.vladmihalcea.flexypool.FlexyPoolDataSource" init-method="start" destroy-method="stop">
    <constructor-arg ref="configuration"/>
    <constructor-arg>
        <array>
            <bean class="com.vladmihalcea.flexypool.strategy.IncrementPoolOnTimeoutConnectionAcquiringStrategy.Factory">
                <constructor-arg value="5"/>
            </bean>
            <bean class="com.vladmihalcea.flexypool.strategy.RetryConnectionAcquiringStrategy.Factory">
                <constructor-arg value="2"/>
            </bean>
        </array>
    </constructor-arg>
</bean>

oracleDataSource here refers to the datasource of my application

After this.. I started the server, and navigated through my application but in JConsole's Mbeans.. I dont see any activity.

Note: I am on weblogic and jdk 1.6

vladmihalcea commented 6 years ago

Go to my book repository, high-performance-java-persistence and run the FlexyPoolTest to see it working.

Then, go to your application and debug both your setup and my test and see where they differ.

vladmihalcea commented 6 years ago

Closing as not able to replicate.

rajanpanchal commented 6 years ago

At least provide a working example before closing

vladmihalcea commented 6 years ago

There are plenty of tests available in FlexyPool to demonstrate how it works. For a bug to be relevant, I need a replicating test case to be provided by the OP. That's typical for many OSS projects.