[hornetq-commits] JBoss hornetq SVN: r10605 - in branches/Branch_2_2_2_REST/hornetq-rest: src/main/java/org/hornetq/rest/queue and 2 other directories.
do-not-reply at jboss.org
do-not-reply at jboss.org
Mon May 9 08:12:28 EDT 2011
Author: bill.burke at jboss.com
Date: 2011-05-09 08:12:27 -0400 (Mon, 09 May 2011)
New Revision: 10605
Removed:
branches/Branch_2_2_2_REST/hornetq-rest/.classpath
branches/Branch_2_2_2_REST/hornetq-rest/.project
Modified:
branches/Branch_2_2_2_REST/hornetq-rest/
branches/Branch_2_2_2_REST/hornetq-rest/pom.xml
branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/QueueConsumer.java
branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/PushConsumer.java
branches/Branch_2_2_2_REST/hornetq-rest/src/test/java/org/hornetq/rest/test/PersistentPushQueueConsumerTest.java
Log:
clebert's fixes
Property changes on: branches/Branch_2_2_2_REST/hornetq-rest
___________________________________________________________________
Modified: svn:ignore
- target
+ target
.classpath
.project
Deleted: branches/Branch_2_2_2_REST/hornetq-rest/.classpath
===================================================================
--- branches/Branch_2_2_2_REST/hornetq-rest/.classpath 2011-05-09 12:09:33 UTC (rev 10604)
+++ branches/Branch_2_2_2_REST/hornetq-rest/.classpath 2011-05-09 12:12:27 UTC (rev 10605)
@@ -1,34 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry including="**/*.java" kind="src" output="target/test-classes" path="src/test/java"/>
- <classpathentry excluding="**/*.java" kind="src" output="target/test-classes" path="src/test/resources"/>
- <classpathentry including="**/*.java" kind="src" path="src/main/java"/>
- <classpathentry kind="var" path="M2_REPO/javax/activation/activation/1.1/activation-1.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.2/commons-codec-1.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/hornetq/hornetq-core/2.2.0.CR1/hornetq-core-2.2.0.CR1.jar" sourcepath="M2_REPO/org/hornetq/hornetq-core/2.2.0.CR1/hornetq-core-2.2.0.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/hornetq/hornetq-jms/2.2.0.CR1/hornetq-jms-2.2.0.CR1.jar" sourcepath="M2_REPO/org/hornetq/hornetq-jms/2.2.0.CR1/hornetq-jms-2.2.0.CR1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-core-asl/1.5.3/jackson-core-asl-1.5.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-jaxrs/1.5.3/jackson-jaxrs-1.5.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-mapper-asl/1.5.3/jackson-mapper-asl-1.5.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/codehaus/jackson/jackson-xc/1.5.3/jackson-xc-1.5.3.jar"/>
- <classpathentry kind="var" path="M2_REPO/javassist/javassist/3.6.0.GA/javassist-3.6.0.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/jaxrs-api/2.0.1.GA/jaxrs-api-2.0.1.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/spec/javax/jms/jboss-jms-api_1.1_spec/1.0.0.Beta1/jboss-jms-api_1.1_spec-1.0.0.Beta1.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/jcip/jcip-annotations/1.0/jcip-annotations-1.0.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.5.8/jcl-over-slf4j-1.5.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.1/junit-4.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/netty/netty/3.2.0.Final/netty-3.2.0.Final.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jackson-provider/2.0.1.GA/resteasy-jackson-provider-2.0.1.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxb-provider/2.0.1.GA/resteasy-jaxb-provider-2.0.1.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/resteasy-jaxrs/2.0.1.GA/resteasy-jaxrs-2.0.1.GA.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/scannotation/scannotation/1.0.2/scannotation-1.0.2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-simple/1.5.8/slf4j-simple-1.5.8.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/jboss/resteasy/tjws/2.0.1.GA/tjws-2.0.1.GA.jar"/>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="var" path="M2_REPO"/>
- <classpathentry kind="output" path="target/classes"/>
-</classpath>
Deleted: branches/Branch_2_2_2_REST/hornetq-rest/.project
===================================================================
--- branches/Branch_2_2_2_REST/hornetq-rest/.project 2011-05-09 12:09:33 UTC (rev 10604)
+++ branches/Branch_2_2_2_REST/hornetq-rest/.project 2011-05-09 12:12:27 UTC (rev 10605)
@@ -1,13 +0,0 @@
-<projectDescription>
- <name>hornetq-rest</name>
- <comment>NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse.</comment>
- <projects/>
- <buildSpec>
- <buildCommand>
- <name>org.eclipse.jdt.core.javabuilder</name>
- </buildCommand>
- </buildSpec>
- <natures>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
\ No newline at end of file
Modified: branches/Branch_2_2_2_REST/hornetq-rest/pom.xml
===================================================================
--- branches/Branch_2_2_2_REST/hornetq-rest/pom.xml 2011-05-09 12:09:33 UTC (rev 10604)
+++ branches/Branch_2_2_2_REST/hornetq-rest/pom.xml 2011-05-09 12:12:27 UTC (rev 10605)
@@ -4,7 +4,7 @@
<parent>
<groupId>org.hornetq.rest</groupId>
<artifactId>hornetq-rest-all</artifactId>
- <version>2.2.2.Final</version>
+ <version>2.2.2.1</version>
</parent>
<groupId>org.hornetq.rest</groupId>
@@ -12,6 +12,10 @@
<packaging>jar</packaging>
<name>HornetQ REST Interface Implementation</name>
+ <properties>
+ <skipRestTests>false</skipRestTests>
+ </properties>
+
<dependencies>
<dependency>
<groupId>org.hornetq</groupId>
@@ -94,6 +98,14 @@
<target>1.6</target>
</configuration>
</plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <configuration>
+ <skipTests>${skipRestTests}</skipTests>
+ </configuration>
+ <version>2.4</version>
+ </plugin>
</plugins>
</build>
Modified: branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/QueueConsumer.java
===================================================================
--- branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/QueueConsumer.java 2011-05-09 12:09:33 UTC (rev 10604)
+++ branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/QueueConsumer.java 2011-05-09 12:12:27 UTC (rev 10605)
@@ -198,7 +198,7 @@
protected void createSession()
throws HornetQException
{
- session = factory.createSession(true, true);
+ session = factory.createSession(true, true, 0);
if (selector == null)
{
consumer = session.createConsumer(destination);
Modified: branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/PushConsumer.java
===================================================================
--- branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/PushConsumer.java 2011-05-09 12:09:33 UTC (rev 10604)
+++ branches/Branch_2_2_2_REST/hornetq-rest/src/main/java/org/hornetq/rest/queue/push/PushConsumer.java 2011-05-09 12:12:27 UTC (rev 10605)
@@ -70,7 +70,7 @@
strategy.setRegistration(registration);
strategy.start();
- session = factory.createSession(false, false);
+ session = factory.createSession(false, false, 0);
if (registration.getSelector() != null)
{
consumer = session.createConsumer(destination, SelectorTranslator.convertToHornetQFilterString(registration.getSelector()));
@@ -127,19 +127,25 @@
@Override
public void onMessage(ClientMessage clientMessage)
{
- boolean acknowledge = strategy.push(clientMessage);
- if (registration.isDisableOnFailure())
+ try
{
- log.error("Failed to push message to "+ registration.getTarget() + " disabling push registration...");
- disableFromFailure();
+ clientMessage.acknowledge();
}
+ catch (HornetQException e)
+ {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+
+ boolean acknowledge = strategy.push(clientMessage);
+
if (acknowledge)
{
try
{
log.debug("Acknowledging: " + clientMessage.getMessageID());
- clientMessage.acknowledge();
+ session.commit();
+ return;
}
catch (HornetQException e)
{
@@ -148,8 +154,20 @@
}
else
{
- // let hornetq decide what to do
- throw new RuntimeException("Failed to push message to "+ registration.getTarget());
+ try
+ {
+ session.rollback();
+ }
+ catch (HornetQException e)
+ {
+ throw new RuntimeException(e.getMessage(), e);
+ }
+ if (registration.isDisableOnFailure())
+ {
+ log.error("Failed to push message to " + registration.getTarget() + " disabling push registration...");
+ disableFromFailure();
+ return;
+ }
}
}
}
Modified: branches/Branch_2_2_2_REST/hornetq-rest/src/test/java/org/hornetq/rest/test/PersistentPushQueueConsumerTest.java
===================================================================
--- branches/Branch_2_2_2_REST/hornetq-rest/src/test/java/org/hornetq/rest/test/PersistentPushQueueConsumerTest.java 2011-05-09 12:09:33 UTC (rev 10604)
+++ branches/Branch_2_2_2_REST/hornetq-rest/src/test/java/org/hornetq/rest/test/PersistentPushQueueConsumerTest.java 2011-05-09 12:12:27 UTC (rev 10605)
@@ -87,6 +87,7 @@
PushRegistration reg = new PushRegistration();
reg.setDurable(true);
+ reg.setDisableOnFailure(true);
XmlLink target = new XmlLink();
target.setHref(generateURL("/queues/forwardQueue"));
target.setRelationship("destination");
More information about the hornetq-commits
mailing list