You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2022/08/03 15:50:34 UTC

[GitHub] [camel] klease opened a new pull request, #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

klease opened a new pull request, #8105:
URL: https://github.com/apache/camel/pull/8105

   <!-- Uncomment and fill this section if your PR is not trivial
   - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/CAMEL) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
   - [ ] Each commit in the pull request should have a meaningful subject line and body.
   - [ ] If you're unsure, you can format the pull request title like `[CAMEL-XXX] Fixes bug in camel-file component`, where you replace `CAMEL-XXX` with the appropriate JIRA issue.
   - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
   - [ ] Run `mvn clean install -Psourcecheck` in your module with source check enabled to make sure basic checks pass and there are no checkstyle violations. A more thorough check will be performed on your pull request automatically.
   Below are the contribution guidelines:
   https://github.com/apache/camel/blob/main/CONTRIBUTING.md
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] klease merged pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
klease merged PR #8105:
URL: https://github.com/apache/camel/pull/8105


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] Gems commented on a diff in pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
Gems commented on code in PR #8105:
URL: https://github.com/apache/camel/pull/8105#discussion_r937993784


##########
core/camel-core/src/test/java/org/apache/camel/processor/OnCompletionBeforeChainedSedaRoutes.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class OnCompletionBeforeChainedSedaRoutes extends ContextTestSupport {
+
+    @Test
+    public void testOnCompletionChained() throws Exception {
+        String body = "<body>";
+
+        getMockEndpoint("mock:end").expectedBodiesReceived(body);

Review Comment:
   Indeed 👍🏻
   I only later noticed that those are expectations for a set of different endpoints.
   
   I'll write a test that delays processing on the second queue and ensures that the "on completion" gets executed meanwhile.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] Gems commented on a diff in pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
Gems commented on code in PR #8105:
URL: https://github.com/apache/camel/pull/8105#discussion_r936853481


##########
core/camel-core/src/test/java/org/apache/camel/processor/OnCompletionBeforeChainedSedaRoutes.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class OnCompletionBeforeChainedSedaRoutes extends ContextTestSupport {
+
+    @Test
+    public void testOnCompletionChained() throws Exception {
+        String body = "<body>";
+
+        getMockEndpoint("mock:end").expectedBodiesReceived(body);

Review Comment:
   I'd expect `"mock:end"` to arrive only after `"mock:cdone"`.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] klease commented on a diff in pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
klease commented on code in PR #8105:
URL: https://github.com/apache/camel/pull/8105#discussion_r937989120


##########
core/camel-core/src/test/java/org/apache/camel/processor/OnCompletionBeforeChainedSedaRoutes.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class OnCompletionBeforeChainedSedaRoutes extends ContextTestSupport {
+
+    @Test
+    public void testOnCompletionChained() throws Exception {
+        String body = "<body>";
+
+        getMockEndpoint("mock:end").expectedBodiesReceived(body);

Review Comment:
   Due to the fact that the SEDA routes are run asynchronously, the order of arrival is indeterminate in the beforeConsumer mode. Also the order in which the expectedBodiesRecieved method is invoked does not control the order in which the assertions are actually evaluated. 
   In the afterConsumer mode, the order of arrival is determinate: end, ddone, cdone, bdone, adone.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] github-actions[bot] commented on pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
github-actions[bot] commented on PR #8105:
URL: https://github.com/apache/camel/pull/8105#issuecomment-1204204574

   :no_entry_sign: There are (likely) no components to be tested in this PR


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] Gems commented on a diff in pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
Gems commented on code in PR #8105:
URL: https://github.com/apache/camel/pull/8105#discussion_r938744733


##########
core/camel-core/src/test/java/org/apache/camel/processor/OnCompletionBeforeChainedSedaRoutes.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class OnCompletionBeforeChainedSedaRoutes extends ContextTestSupport {
+
+    @Test
+    public void testOnCompletionChained() throws Exception {
+        String body = "<body>";
+
+        getMockEndpoint("mock:end").expectedBodiesReceived(body);

Review Comment:
   [Here](https://github.com/apache/camel/pull/8120) you go. Looks nice! Thank you for your effort 👍🏻



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [camel] klease commented on a diff in pull request #8105: CAMEL-18275: prevent completion in beforeConsumer mode from being handed over

Posted by GitBox <gi...@apache.org>.
klease commented on code in PR #8105:
URL: https://github.com/apache/camel/pull/8105#discussion_r937996779


##########
core/camel-core/src/test/java/org/apache/camel/processor/OnCompletionBeforeChainedSedaRoutes.java:
##########
@@ -0,0 +1,64 @@
+/*
+ * 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.processor;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.builder.RouteBuilder;
+import org.junit.jupiter.api.Test;
+
+public class OnCompletionBeforeChainedSedaRoutes extends ContextTestSupport {
+
+    @Test
+    public void testOnCompletionChained() throws Exception {
+        String body = "<body>";
+
+        getMockEndpoint("mock:end").expectedBodiesReceived(body);

Review Comment:
   That would be great. It was beyond my vacation-mode motivation. -:)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org