You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2013/11/05 12:00:30 UTC
[1/2] git commit: Added some logging when reply manager is being
stopped so its easier to pair the start/stop logs.
Updated Branches:
refs/heads/camel-2.12.x 46fbd4b92 -> badc9f628
Added some logging when reply manager is being stopped so its easier to pair the start/stop logs.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/83ef2f7c
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/83ef2f7c
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/83ef2f7c
Branch: refs/heads/camel-2.12.x
Commit: 83ef2f7cf70fd81e3f830b356e1c9b98128a4dbe
Parents: 46fbd4b
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Nov 5 11:58:37 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 5 12:00:54 2013 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/component/jms/JmsProducer.java | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/83ef2f7c/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
----------------------------------------------------------------------
diff --git a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
index 3af7aab..096df8c 100644
--- a/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
+++ b/components/camel-jms/src/main/java/org/apache/camel/component/jms/JmsProducer.java
@@ -117,7 +117,13 @@ public class JmsProducer extends DefaultAsyncProducer {
protected void unInitReplyManager() {
try {
- ServiceHelper.stopService(replyManager);
+ if (replyManager != null) {
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("Stopping JmsReplyManager: {} from processing replies from: {}", replyManager,
+ endpoint.getReplyTo() != null ? endpoint.getReplyTo() : "temporary queue");
+ }
+ ServiceHelper.stopService(replyManager);
+ }
} catch (Exception e) {
throw ObjectHelper.wrapRuntimeCamelException(e);
} finally {
[2/2] git commit: Added unit test based on user forum issue
Posted by da...@apache.org.
Added unit test based on user forum issue
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/badc9f62
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/badc9f62
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/badc9f62
Branch: refs/heads/camel-2.12.x
Commit: badc9f628125d8b76d48d333a2221bf2f0ae9c45
Parents: 83ef2f7
Author: Claus Ibsen <da...@apache.org>
Authored: Tue Nov 5 11:29:34 2013 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Tue Nov 5 12:01:05 2013 +0100
----------------------------------------------------------------------
...ExceptionAndRollbackUsingTransactedTest.java | 32 ++++++++
...pedOnExceptionAndRollbackUsingTransacted.xml | 79 ++++++++++++++++++++
2 files changed, 111 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/badc9f62/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/SpringTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransactedTest.java
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/SpringTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransactedTest.java b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/SpringTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransactedTest.java
new file mode 100644
index 0000000..9a9a4d6
--- /dev/null
+++ b/components/camel-spring/src/test/java/org/apache/camel/spring/interceptor/SpringTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransactedTest.java
@@ -0,0 +1,32 @@
+/**
+ * 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.camel.spring.interceptor;
+
+import org.springframework.context.support.AbstractXmlApplicationContext;
+import org.springframework.context.support.ClassPathXmlApplicationContext;
+
+/**
+ * Easier transaction configuration as we do not have to setup a transaction error handler
+ */
+public class SpringTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransactedTest extends SpringTransactionalClientDataWithOnExceptionAndRollbackUsingTransactedTest {
+
+ protected AbstractXmlApplicationContext createApplicationContext() {
+ return new ClassPathXmlApplicationContext(
+ "/org/apache/camel/spring/interceptor/springTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransacted.xml");
+ }
+
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/camel/blob/badc9f62/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransacted.xml
----------------------------------------------------------------------
diff --git a/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransacted.xml b/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransacted.xml
new file mode 100644
index 0000000..b7986db
--- /dev/null
+++ b/components/camel-spring/src/test/resources/org/apache/camel/spring/interceptor/springTransactionalClientDataWithRouteScopedOnExceptionAndRollbackUsingTransacted.xml
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<beans xmlns="http://www.springframework.org/schema/beans"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="
+ http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+ http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd">
+
+ <import resource="transactionalClientDataSource.xml"/>
+
+ <!-- START SNIPPET: e1 -->
+ <camelContext xmlns="http://camel.apache.org/schema/spring">
+
+ <route>
+ <from uri="direct:okay"/>
+ <transacted/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:error"/>
+ <transform>
+ <constant>Sorry</constant>
+ </transform>
+ <rollback markRollbackOnly="true"/>
+ </onException>
+ <setBody>
+ <constant>Tiger in Action</constant>
+ </setBody>
+ <bean ref="bookService"/>
+ <setBody>
+ <constant>Elephant in Action</constant>
+ </setBody>
+ <bean ref="bookService"/>
+ </route>
+
+ <route>
+ <from uri="direct:fail"/>
+ <transacted/>
+ <onException>
+ <exception>java.lang.IllegalArgumentException</exception>
+ <handled>
+ <constant>true</constant>
+ </handled>
+ <to uri="mock:error"/>
+ <transform>
+ <constant>Sorry</constant>
+ </transform>
+ <rollback markRollbackOnly="true"/>
+ </onException>
+ <setBody>
+ <constant>Tiger in Action</constant>
+ </setBody>
+ <bean ref="bookService"/>
+ <setBody>
+ <constant>Donkey in Action</constant>
+ </setBody>
+ <bean ref="bookService"/>
+ </route>
+ </camelContext>
+ <!-- END SNIPPET: e1 -->
+
+</beans>