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 2016/08/28 07:42:51 UTC
[2/2] camel git commit: CAMEL-10271: Fixed camel-jt400 consumer as
its not polling based.
CAMEL-10271: Fixed camel-jt400 consumer as its not polling based.
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/1c07ce24
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/1c07ce24
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/1c07ce24
Branch: refs/heads/camel-2.17.x
Commit: 1c07ce24201ea31978eabfd305b7c0002c34b8da
Parents: f70e1e3
Author: Claus Ibsen <da...@apache.org>
Authored: Sun Aug 28 09:38:48 2016 +0200
Committer: Claus Ibsen <da...@apache.org>
Committed: Sun Aug 28 09:42:21 2016 +0200
----------------------------------------------------------------------
.../apache/camel/component/jt400/Jt400DataQueueConsumer.java | 7 ++-----
.../java/org/apache/camel/component/jt400/Jt400Endpoint.java | 4 ++--
2 files changed, 4 insertions(+), 7 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/1c07ce24/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400DataQueueConsumer.java
----------------------------------------------------------------------
diff --git a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400DataQueueConsumer.java b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400DataQueueConsumer.java
index 825af3c..c3ff46e 100644
--- a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400DataQueueConsumer.java
+++ b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400DataQueueConsumer.java
@@ -23,7 +23,6 @@ import com.ibm.as400.access.KeyedDataQueue;
import com.ibm.as400.access.KeyedDataQueueEntry;
import org.apache.camel.Exchange;
import org.apache.camel.RuntimeCamelException;
-import org.apache.camel.impl.DefaultExchange;
import org.apache.camel.impl.PollingConsumerSupport;
/**
@@ -107,8 +106,7 @@ public class Jt400DataQueueConsumer extends PollingConsumerSupport {
entry = queue.read(-1);
}
- Exchange exchange = new DefaultExchange(endpoint.getCamelContext());
- exchange.setFromEndpoint(endpoint);
+ Exchange exchange = getEndpoint().createExchange();
if (entry != null) {
exchange.getIn().setHeader(Jt400Endpoint.SENDER_INFORMATION, entry.getSenderInformation());
if (endpoint.getFormat() == Jt400Configuration.Format.binary) {
@@ -134,8 +132,7 @@ public class Jt400DataQueueConsumer extends PollingConsumerSupport {
entry = queue.read(key, -1, searchType);
}
- Exchange exchange = new DefaultExchange(endpoint.getCamelContext());
- exchange.setFromEndpoint(endpoint);
+ Exchange exchange = getEndpoint().createExchange();
if (entry != null) {
exchange.getIn().setHeader(Jt400Endpoint.SENDER_INFORMATION, entry.getSenderInformation());
if (endpoint.getFormat() == Jt400Configuration.Format.binary) {
http://git-wip-us.apache.org/repos/asf/camel/blob/1c07ce24/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
index 7f6ae43..849e683 100644
--- a/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
+++ b/components/camel-jt400/src/main/java/org/apache/camel/component/jt400/Jt400Endpoint.java
@@ -27,7 +27,7 @@ import org.apache.camel.Consumer;
import org.apache.camel.PollingConsumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
-import org.apache.camel.impl.DefaultPollingEndpoint;
+import org.apache.camel.impl.DefaultEndpoint;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.util.ObjectHelper;
@@ -37,7 +37,7 @@ import org.apache.camel.util.URISupport;
* The jt400 component allows you to exchanges messages with an AS/400 system using data queues or program call.
*/
@UriEndpoint(scheme = "jt400", title = "JT400", syntax = "jt400:userID:password/systemName/objectPath.type", consumerClass = Jt400DataQueueConsumer.class, label = "messaging")
-public class Jt400Endpoint extends DefaultPollingEndpoint {
+public class Jt400Endpoint extends DefaultEndpoint {
public static final String KEY = "KEY";
public static final String SENDER_INFORMATION = "SENDER_INFORMATION";