diff --git a/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpClientInterceptor.java b/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpClientInterceptor.java index 05370607..6aeaa317 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpClientInterceptor.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpClientInterceptor.java @@ -38,7 +38,9 @@ import org.springframework.remoting.support.RemoteInvocationResult; * @see org.springframework.amqp.remoting.service.AmqpInvokerServiceExporter * @see AmqpProxyFactoryBean * @see org.springframework.remoting.RemoteAccessException + * @deprecated will be removed in 3.0.0. */ +@Deprecated public class AmqpClientInterceptor extends RemoteAccessor implements MethodInterceptor { private AmqpTemplate amqpTemplate; diff --git a/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpProxyFactoryBean.java b/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpProxyFactoryBean.java index d63ddce6..4ce946f4 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpProxyFactoryBean.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/remoting/client/AmqpProxyFactoryBean.java @@ -40,7 +40,9 @@ import org.springframework.beans.factory.InitializingBean; * @see AmqpClientInterceptor * @see org.springframework.remoting.rmi.RmiServiceExporter * @see org.springframework.remoting.RemoteAccessException + * @deprecated will be removed in 3.0.0. */ +@Deprecated public class AmqpProxyFactoryBean extends AmqpClientInterceptor implements FactoryBean, InitializingBean { private Object serviceProxy; diff --git a/spring-amqp/src/main/java/org/springframework/amqp/remoting/service/AmqpInvokerServiceExporter.java b/spring-amqp/src/main/java/org/springframework/amqp/remoting/service/AmqpInvokerServiceExporter.java index ca14839e..13817fde 100644 --- a/spring-amqp/src/main/java/org/springframework/amqp/remoting/service/AmqpInvokerServiceExporter.java +++ b/spring-amqp/src/main/java/org/springframework/amqp/remoting/service/AmqpInvokerServiceExporter.java @@ -53,7 +53,9 @@ import org.springframework.remoting.support.RemoteInvocationResult; * @author Gary Russell * @author Artem Bilan * @since 1.2 + * @deprecated will be removed in 3.0.0. */ +@Deprecated public class AmqpInvokerServiceExporter extends RemoteInvocationBasedExporter implements MessageListener { private AmqpTemplate amqpTemplate; diff --git a/spring-amqp/src/test/java/org/springframework/amqp/remoting/RemotingTest.java b/spring-amqp/src/test/java/org/springframework/amqp/remoting/RemotingTest.java index fc1acdf2..bf46a250 100644 --- a/spring-amqp/src/test/java/org/springframework/amqp/remoting/RemotingTest.java +++ b/spring-amqp/src/test/java/org/springframework/amqp/remoting/RemotingTest.java @@ -29,8 +29,6 @@ import org.springframework.amqp.core.Address; import org.springframework.amqp.core.AmqpTemplate; import org.springframework.amqp.core.Message; import org.springframework.amqp.core.MessageProperties; -import org.springframework.amqp.remoting.client.AmqpProxyFactoryBean; -import org.springframework.amqp.remoting.service.AmqpInvokerServiceExporter; import org.springframework.amqp.remoting.testhelper.AbstractAmqpTemplate; import org.springframework.amqp.remoting.testhelper.SentSavingTemplate; import org.springframework.amqp.remoting.testservice.GeneralException; @@ -49,11 +47,12 @@ import org.springframework.remoting.support.RemoteInvocation; * @author Gary Russell * @since 1.2 */ +@SuppressWarnings("deprecation") public class RemotingTest { private TestServiceInterface riggedProxy; - private AmqpInvokerServiceExporter serviceExporter; + private org.springframework.amqp.remoting.service.AmqpInvokerServiceExporter serviceExporter; /** * Set up a rig of directly wired-up proxy and service listener so that both can be tested together without needing @@ -63,14 +62,15 @@ public class RemotingTest { public void initializeTestRig() { // Set up the service TestServiceInterface testService = new TestServiceImpl(); - this.serviceExporter = new AmqpInvokerServiceExporter(); + this.serviceExporter = new org.springframework.amqp.remoting.service.AmqpInvokerServiceExporter(); final SentSavingTemplate sentSavingTemplate = new SentSavingTemplate(); this.serviceExporter.setAmqpTemplate(sentSavingTemplate); this.serviceExporter.setService(testService); this.serviceExporter.setServiceInterface(TestServiceInterface.class); // Set up the client - AmqpProxyFactoryBean amqpProxyFactoryBean = new AmqpProxyFactoryBean(); + org.springframework.amqp.remoting.client.AmqpProxyFactoryBean amqpProxyFactoryBean = + new org.springframework.amqp.remoting.client.AmqpProxyFactoryBean(); amqpProxyFactoryBean.setServiceInterface(TestServiceInterface.class); AmqpTemplate directForwardingTemplate = new AbstractAmqpTemplate() { @Override diff --git a/src/reference/asciidoc/amqp.adoc b/src/reference/asciidoc/amqp.adoc index 07b32923..a471d8e3 100644 --- a/src/reference/asciidoc/amqp.adoc +++ b/src/reference/asciidoc/amqp.adoc @@ -4581,6 +4581,10 @@ See <> for more information. [[remoting]] ===== Spring Remoting with AMQP +IMPORTANT: This feature is deprecated and will be removed in 3.0. +It has been superseded for a long time by <> with the `returnExceptions` being set to true, and configuring a `RemoteInvocationAwareMessageConverterAdapter` on the sending side. +See <> for more information. + The Spring Framework has a general remoting capability, allowing https://docs.spring.io/spring/docs/current/spring-framework-reference/html/remoting.html[Remote Procedure Calls (RPC)] that use various transports. Spring-AMQP supports a similar mechanism with a `AmqpProxyFactoryBean` on the client and a `AmqpInvokerServiceExporter` on the server. This provides RPC over AMQP. diff --git a/src/reference/asciidoc/whats-new.adoc b/src/reference/asciidoc/whats-new.adoc index ba34b2f0..5e6673f4 100644 --- a/src/reference/asciidoc/whats-new.adoc +++ b/src/reference/asciidoc/whats-new.adoc @@ -15,3 +15,8 @@ See <> for more information. A new property `recoverManualDeclarations` allows recovery of manually declared queues/exchanges/bindings. See <> for more information. + +==== Remoting Support + +Support remoting using Spring Framework's RMI support is deprecated and will be removed in 3.0. +See <> for more information.