GH-1383: Deprecate Remoting
Resolves https://github.com/spring-projects/spring-amqp/issues/1383
This commit is contained in:
committed by
Artem Bilan
parent
18d58b5ef3
commit
1f6225b73e
@@ -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;
|
||||
|
||||
@@ -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<Object>, InitializingBean {
|
||||
|
||||
private Object serviceProxy;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -4581,6 +4581,10 @@ See <<json-complex>> 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 <<annotation-error-handling>> with the `returnExceptions` being set to true, and configuring a `RemoteInvocationAwareMessageConverterAdapter` on the sending side.
|
||||
See <<annotation-error-handling>> 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.
|
||||
|
||||
@@ -15,3 +15,8 @@ See <<async-annotation-driven-enable-signature>> for more information.
|
||||
|
||||
A new property `recoverManualDeclarations` allows recovery of manually declared queues/exchanges/bindings.
|
||||
See <<declarable-recovery>> for more information.
|
||||
|
||||
==== Remoting Support
|
||||
|
||||
Support remoting using Spring Framework's RMI support is deprecated and will be removed in 3.0.
|
||||
See <<remoting>> for more information.
|
||||
|
||||
Reference in New Issue
Block a user