Sounds like you need to make yourself familiar with Enterprise Integration Patterns and it implementation with Spring Integration. There is a pattern like gateway and this framework has an implementation of it for JMS outbound requests/replies: https://docs.spring.io/spring-integration/docs/current/reference/html/jms.html#jms-outbound-gateway.
On the other hand Spring AMQP doesn't support AMQP 1.0 protocol, which is more likely can be processed by regular JMS API.
The JmsTemplate
from Spring JMS also provides for us an API like:
/**
* Send a message and receive the reply from the specified destination. The
* {@link MessageCreator} callback creates the message given a Session. A temporary
* queue is created as part of this operation and is set in the {@code JMSReplyTO}
* header of the message.
* @param destinationName the name of the destination to send this message to
* (to be resolved to an actual destination by a DestinationResolver)
* @param messageCreator callback to create a message
* @return the reply, possibly {@code null} if the message could not be received,
* for example due to a timeout
* @throws JmsException checked JMSException converted to unchecked
* @since 4.1
*/
@Nullable
Message sendAndReceive(String destinationName, MessageCreator messageCreator) throws JmsException;
So, you may consider to use this as well, if Spring Integration is too hard to bring to your project right away.
If you are confusing AMQP 0.9 with JMS, then you really can stay with Spring AMQP project and its RabbitTemplate.sendAndReceive()
.