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 2018/04/10 14:22:29 UTC

[camel] 03/03: CAMEL-12427: camel-netty4 - Add SPI to plugin custom correlation state for request/reply in producer

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-2.21.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c88196aa1e9caed914816d5e5cdb99cfb5c273b9
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Tue Apr 10 09:47:34 2018 +0200

    CAMEL-12427: camel-netty4 - Add SPI to plugin custom correlation state for request/reply in producer
---
 .../component/netty4/NettyCustomCorrelationManagerTest.java    | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyCustomCorrelationManagerTest.java b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyCustomCorrelationManagerTest.java
index 35b2d6b..9925a98 100644
--- a/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyCustomCorrelationManagerTest.java
+++ b/components/camel-netty4/src/test/java/org/apache/camel/component/netty4/NettyCustomCorrelationManagerTest.java
@@ -18,8 +18,6 @@ package org.apache.camel.component.netty4;
 
 import io.netty.channel.Channel;
 import io.netty.channel.ChannelHandlerContext;
-import org.apache.camel.Exchange;
-import org.apache.camel.Predicate;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.impl.JndiRegistry;
@@ -64,7 +62,7 @@ public class NettyCustomCorrelationManagerTest extends BaseNettyTest {
             public void configure() throws Exception {
                 from("seda:start")
                     .log("before ${body}")
-                    .to("netty4:tcp://localhost:{{port}}?textline=true&sync=true&correlationManager=#myManager")
+                    .to("netty4:tcp://localhost:{{port}}?textline=true&sync=true&producerPoolEnabled=false&correlationManager=#myManager")
                     .log("after ${body}")
                     .to("mock:result");
 
@@ -79,9 +77,15 @@ public class NettyCustomCorrelationManagerTest extends BaseNettyTest {
         private volatile NettyCamelState stateA;
         private volatile NettyCamelState stateB;
         private volatile NettyCamelState stateC;
+        private volatile Channel channel;
 
         @Override
         public void putState(Channel channel, NettyCamelState state) {
+            if (this.channel != null && this.channel != channel) {
+                throw new IllegalStateException("Should use same channel as producer pool is disabled");
+            }
+            this.channel = channel;
+
             String body = state.getExchange().getMessage().getBody(String.class);
             if ("A".equals(body)) {
                 stateA = state;

-- 
To stop receiving notification emails like this one, please contact
davsclaus@apache.org.