INT-2683 Add Reply Listener Container Option
INT-2683 Tests Expanded JMS Gateway Tests INT-2683 First commit Listener Container Option for Replies INT-2683 Remove no correlation-key Option INT-2863 Support DestName and Temp Dest INT-2683 Add back Support No CorrelationKey INT-2683 Fix Tests INT-2683 Polishing Fallback if no correlationKey and fixed reply queue. INT-2683 Polishing Change from SMLC to DMLC INT-2683 Polishing Since we changed to DMLC, we can now remove the check for SingleConnectionFactory. INT-2683 <reply-listener/> Namespace Support Add <reply-listener/> subelement to JMS Outbound Gateway.
This commit is contained in:
committed by
Oleg Zhurakousky
parent
9e8d1c83f8
commit
49a6079d1a
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.integration.endpoint;
|
||||
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.integration.context.IntegrationObjectSupport;
|
||||
import org.springframework.integration.context.NamedComponent;
|
||||
import org.springframework.integration.core.MessageHandler;
|
||||
@@ -25,9 +26,10 @@ import org.springframework.util.StringUtils;
|
||||
|
||||
/**
|
||||
* Message Endpoint that connects any {@link MessageHandler} implementation to a {@link SubscribableChannel}.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gary Russell
|
||||
*/
|
||||
public class EventDrivenConsumer extends AbstractEndpoint {
|
||||
|
||||
@@ -45,18 +47,24 @@ public class EventDrivenConsumer extends AbstractEndpoint {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@Override
|
||||
protected void doStart() {
|
||||
this.logComponentSubscriptionEvent(true);
|
||||
this.inputChannel.subscribe(this.handler);
|
||||
if (this.handler instanceof Lifecycle) {
|
||||
((Lifecycle) this.handler).start();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
protected void doStop() {
|
||||
this.logComponentSubscriptionEvent(false);
|
||||
this.inputChannel.unsubscribe(this.handler);
|
||||
if (this.handler instanceof Lifecycle) {
|
||||
((Lifecycle) this.handler).stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void logComponentSubscriptionEvent(boolean add){
|
||||
if (this.handler instanceof NamedComponent && this.inputChannel instanceof NamedComponent){
|
||||
String channelName = ((NamedComponent)this.inputChannel).getComponentName();
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2010 the original author or authors.
|
||||
* Copyright 2002-2012 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -18,7 +18,7 @@ package org.springframework.integration.endpoint;
|
||||
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
import org.springframework.context.Lifecycle;
|
||||
import org.springframework.integration.Message;
|
||||
import org.springframework.integration.core.MessageHandler;
|
||||
import org.springframework.integration.core.PollableChannel;
|
||||
@@ -27,20 +27,21 @@ import org.springframework.util.Assert;
|
||||
/**
|
||||
* Message Endpoint that connects any {@link MessageHandler} implementation
|
||||
* to a {@link PollableChannel}.
|
||||
*
|
||||
*
|
||||
* @author Mark Fisher
|
||||
* @author Oleg Zhurakousky
|
||||
* @author Gary Russell
|
||||
*/
|
||||
public class PollingConsumer extends AbstractPollingEndpoint {
|
||||
|
||||
private final Log logger = LogFactory.getLog(this.getClass());
|
||||
|
||||
|
||||
private final PollableChannel inputChannel;
|
||||
|
||||
private final MessageHandler handler;
|
||||
|
||||
private volatile long receiveTimeout = 1000;
|
||||
|
||||
|
||||
public PollingConsumer(PollableChannel inputChannel, MessageHandler handler) {
|
||||
Assert.notNull(inputChannel, "inputChannel must not be null");
|
||||
Assert.notNull(handler, "handler must not be null");
|
||||
@@ -53,6 +54,24 @@ public class PollingConsumer extends AbstractPollingEndpoint {
|
||||
this.receiveTimeout = receiveTimeout;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void doStart() {
|
||||
if (this.handler instanceof Lifecycle) {
|
||||
((Lifecycle) this.handler).start();
|
||||
}
|
||||
super.doStart();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected void doStop() {
|
||||
if (this.handler instanceof Lifecycle) {
|
||||
((Lifecycle) this.handler).stop();
|
||||
}
|
||||
super.doStop();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean doPoll() {
|
||||
Message<?> message = (this.receiveTimeout >= 0)
|
||||
|
||||
Reference in New Issue
Block a user