|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.springframework.remoting.support.RemotingSupport
org.springframework.remoting.support.RemoteExporter
org.springframework.remoting.support.RemoteInvocationBasedExporter
org.springframework.amqp.remoting.service.AmqpInvokerServiceExporter
public class AmqpInvokerServiceExporter
This message listener exposes a plain java service via AMQP. Such services can be accessed via plain AMQP or via
AmqpProxyFactoryBean.
To configure this message listener so that it actually receives method calls via AMQP, it needs to be put into a
listener container. See MessageListener.
When receiving a message, a service method is called according to the contained RemoteInvocation. The result
of that invocation is returned as a RemoteInvocationResult contained in a message that is sent according to
the ReplyToAddress of the received message.
Please note that this exporter does not use the MessageConverter of the injected AmqpTemplate to
convert incoming calls and their results. Instead you have to directly inject the MessageConverter into
this class.
This listener responds to "Request/Reply"-style messages as described here.
| Field Summary |
|---|
| Fields inherited from class org.springframework.remoting.support.RemotingSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
AmqpInvokerServiceExporter()
|
|
| Method Summary | |
|---|---|
AmqpTemplate |
getAmqpTemplate()
|
MessageConverter |
getMessageConverter()
|
void |
onMessage(Message message)
|
void |
setAmqpTemplate(AmqpTemplate amqpTemplate)
The AMQP template to use for sending the return value. |
void |
setMessageConverter(MessageConverter messageConverter)
Set the message converter for this remote service. |
| Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter |
|---|
getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor |
| Methods inherited from class org.springframework.remoting.support.RemoteExporter |
|---|
checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface |
| Methods inherited from class org.springframework.remoting.support.RemotingSupport |
|---|
getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public AmqpInvokerServiceExporter()
| Method Detail |
|---|
public void onMessage(Message message)
onMessage in interface MessageListenerpublic AmqpTemplate getAmqpTemplate()
public void setAmqpTemplate(AmqpTemplate amqpTemplate)
Note that the exchange and routing key parameters on this template are ignored for these return messages. Instead
of those the respective parameters from the original message's returnAddress are being used.
Also, the template's MessageConverter is not used for the reply.
setMessageConverter(MessageConverter)public MessageConverter getMessageConverter()
public void setMessageConverter(MessageConverter messageConverter)
The default converter is a SimpleMessageConverter, which is able to handle byte arrays, Strings, and Serializable Objects depending on the message content type header.
Note that this class never uses the message converter of the underlying AmqpTemplate!
SimpleMessageConverter
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||