Permalink
Browse files

Upgrade to: amqp-client 2.8.4, junit 4.10, mockit-core 1.9.0, spring-…

…test 3.1.1.RELEASE
  • Loading branch information...
joshdevins committed Jun 24, 2012
1 parent f625324 commit 87a09d042fb3625bdf0581694b90370d8d183934
View
274 pom.xml
@@ -1,148 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
- <modelVersion>4.0.0</modelVersion>
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+ <modelVersion>4.0.0</modelVersion>
- <groupId>net.joshdevins.rabbitmq</groupId>
- <artifactId>rabbitmq-ha-client</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <packaging>jar</packaging>
+ <groupId>net.joshdevins.rabbitmq</groupId>
+ <artifactId>rabbitmq-ha-client</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <packaging>jar</packaging>
- <name>RabbitMQ HA Client</name>
- <url>http://github.com/joshdevins/rabbitmq-ha-client</url>
+ <name>RabbitMQ HA Client</name>
+ <url>http://github.com/joshdevins/rabbitmq-ha-client</url>
- <dependencies>
- <dependency>
- <groupId>com.rabbitmq</groupId>
- <artifactId>amqp-client</artifactId>
- <version>1.7.2</version>
- <exclusions>
- <exclusion>
- <groupId>commons-cli</groupId>
- <artifactId>commons-cli</artifactId>
- </exclusion>
- <exclusion>
- <groupId>commons-io</groupId>
- <artifactId>commons-io</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
+ <dependencies>
+ <dependency>
+ <groupId>com.rabbitmq</groupId>
+ <artifactId>amqp-client</artifactId>
+ <version>2.8.4</version>
+ <exclusions>
+ <exclusion>
+ <groupId>commons-cli</groupId>
+ <artifactId>commons-cli</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>commons-io</groupId>
+ <artifactId>commons-io</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
- <!-- STANDARD -->
- <dependency>
- <groupId>log4j</groupId>
- <artifactId>log4j</artifactId>
- <version>1.2.15</version>
- <exclusions>
- <exclusion>
- <groupId>javax.mail</groupId>
- <artifactId>mail</artifactId>
- </exclusion>
- <exclusion>
- <groupId>javax.jms</groupId>
- <artifactId>jms</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jdmk</groupId>
- <artifactId>jmxtools</artifactId>
- </exclusion>
- <exclusion>
- <groupId>com.sun.jmx</groupId>
- <artifactId>jmxri</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>commons-lang</groupId>
- <artifactId>commons-lang</artifactId>
- <version>2.5</version>
- </dependency>
+ <!-- STANDARD -->
+ <dependency>
+ <groupId>log4j</groupId>
+ <artifactId>log4j</artifactId>
+ <version>1.2.15</version>
+ <exclusions>
+ <exclusion>
+ <groupId>javax.mail</groupId>
+ <artifactId>mail</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>javax.jms</groupId>
+ <artifactId>jms</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jdmk</groupId>
+ <artifactId>jmxtools</artifactId>
+ </exclusion>
+ <exclusion>
+ <groupId>com.sun.jmx</groupId>
+ <artifactId>jmxri</artifactId>
+ </exclusion>
+ </exclusions>
+ </dependency>
+ <dependency>
+ <groupId>commons-lang</groupId>
+ <artifactId>commons-lang</artifactId>
+ <version>2.5</version>
+ </dependency>
- <!-- TEST -->
- <dependency>
- <groupId>junit</groupId>
- <artifactId>junit</artifactId>
- <version>4.8.1</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.mockito</groupId>
- <artifactId>mockito-core</artifactId>
- <version>1.8.4</version>
- <scope>test</scope>
- </dependency>
+ <!-- TEST -->
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.10</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.mockito</groupId>
+ <artifactId>mockito-core</artifactId>
+ <version>1.9.0</version>
+ <scope>test</scope>
+ </dependency>
- <!-- INTEGRATION TEST -->
- <!-- IT - SPRING, SPRING EXT -->
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-rabbit</artifactId>
- <version>1.0.0-SNAPSHOT</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.springframework</groupId>
- <artifactId>spring-test</artifactId>
- <version>3.0.2.RELEASE</version>
- <scope>test</scope>
- </dependency>
- </dependencies>
+ <!-- INTEGRATION TEST -->
+ <!-- IT - SPRING, SPRING EXT -->
+ <dependency>
+ <groupId>org.springframework.amqp</groupId>
+ <artifactId>spring-rabbit</artifactId> <!-- TODO: upgrade to spring-amqp, 1.1.1.RELEASE -->
+ <version>1.0.0.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.springframework</groupId>
+ <artifactId>spring-test</artifactId>
+ <version>3.1.1.RELEASE</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <source>1.5</source>
- <target>1.5</target>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-eclipse-plugin</artifactId>
- <configuration>
- <downloadSources>true</downloadSources>
- <downloadJavadocs>true</downloadJavadocs>
- </configuration>
- </plugin>
- <plugin>
- <artifactId>maven-surefire-plugin</artifactId>
- <configuration>
- <skip>true</skip>
- </configuration>
- <executions>
- <execution>
- <id>surefire-test</id>
- <phase>test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>false</skip>
- <excludes>
- <exclude>**/*IntegrationTest.java</exclude>
- </excludes>
- </configuration>
- </execution>
- <execution>
- <id>surefire-itest</id>
- <phase>integration-test</phase>
- <goals>
- <goal>test</goal>
- </goals>
- <configuration>
- <skip>true</skip> <!-- disabled for now -->
- <includes>
- <include>**/*IntegrationTest.java</include>
- </includes>
- </configuration>
- </execution>
- </executions>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-eclipse-plugin</artifactId>
+ <configuration>
+ <downloadSources>true</downloadSources>
+ <downloadJavadocs>true</downloadJavadocs>
+ </configuration>
+ </plugin>
+ <plugin>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skip>true</skip>
+ </configuration>
+ <executions>
+ <execution>
+ <id>surefire-test</id>
+ <phase>test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>false</skip>
+ <excludes>
+ <exclude>**/*IntegrationTest.java</exclude>
+ </excludes>
+ </configuration>
+ </execution>
+ <execution>
+ <id>surefire-itest</id>
+ <phase>integration-test</phase>
+ <goals>
+ <goal>test</goal>
+ </goals>
+ <configuration>
+ <skip>true</skip> <!-- disabled for now -->
+ <includes>
+ <include>**/*IntegrationTest.java</include>
+ </includes>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- </properties>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
</project>
@@ -35,7 +35,6 @@
import com.rabbitmq.client.Channel;
import com.rabbitmq.client.Connection;
import com.rabbitmq.client.ConnectionFactory;
-import com.rabbitmq.client.ConnectionParameters;
import com.rabbitmq.client.ShutdownListener;
import com.rabbitmq.client.ShutdownSignalException;
@@ -156,13 +155,7 @@ public void run() {
Exception exception = null;
try {
- Connection connection;
- if (connectionProxy.getMaxRedirects() == null) {
- connection = newTargetConnection(connectionProxy.getAddresses(), 0);
- } else {
- connection = newTargetConnection(connectionProxy.getAddresses(), connectionProxy
- .getMaxRedirects());
- }
+ Connection connection = newTargetConnection(connectionProxy.getAddresses());
if (LOG.isDebugEnabled()) {
LOG.info("Reconnection complete: addresses=" + addressesAsString);
@@ -251,11 +244,7 @@ private String getAddressesAsString() {
private Set<HaConnectionListener> listeners;
public HaConnectionFactory() {
- this(new ConnectionParameters());
- }
-
- public HaConnectionFactory(final ConnectionParameters params) {
- super(params);
+ super();
executorService = Executors.newCachedThreadPool();
setDefaultRetryStrategy();
@@ -274,18 +263,18 @@ public void addHaConnectionListener(final HaConnectionListener listener) {
* @see ConnectionFactory#newConnection(Address[], int)
*/
@Override
- public Connection newConnection(final Address[] addrs, final int maxRedirects) throws IOException {
+ public Connection newConnection(final Address[] addrs) throws IOException {
Connection target = null;
try {
- target = super.newConnection(addrs, maxRedirects);
+ target = super.newConnection(addrs);
} catch (IOException ioe) {
LOG.warn("Initial connection failed, wrapping anyways and letting reconnector go to work: "
+ ioe.getMessage());
}
- ConnectionSet connectionPair = createConnectionProxy(addrs, maxRedirects, target);
+ ConnectionSet connectionPair = createConnectionProxy(addrs, target);
// connection success
if (target != null) {
@@ -329,13 +318,13 @@ public void setRetryStrategy(final RetryStrategy retryStrategy) {
/**
* Creates an {@link HaConnectionProxy} around a raw {@link Connection}.
*/
- protected ConnectionSet createConnectionProxy(final Address[] addrs, final Integer maxRedirects,
+ protected ConnectionSet createConnectionProxy(final Address[] addrs,
final Connection targetConnection) {
ClassLoader classLoader = Connection.class.getClassLoader();
Class<?>[] interfaces = { Connection.class };
- HaConnectionProxy proxy = new HaConnectionProxy(addrs, maxRedirects, targetConnection, retryStrategy);
+ HaConnectionProxy proxy = new HaConnectionProxy(addrs, targetConnection, retryStrategy);
if (LOG.isDebugEnabled()) {
LOG
@@ -354,8 +343,8 @@ protected ConnectionSet createConnectionProxy(final Address[] addrs, final Integ
return new ConnectionSet(target, proxy, listener);
}
- private Connection newTargetConnection(final Address[] addrs, final int maxRedirects) throws IOException {
- return super.newConnection(addrs, maxRedirects);
+ private Connection newTargetConnection(final Address[] addrs) throws IOException {
+ return super.newConnection(addrs);
}
private void setDefaultRetryStrategy() {
Oops, something went wrong.

0 comments on commit 87a09d0

Please sign in to comment.