0
votes

i am trying to write my first AMQP publisher via spring integration using an instance of AmqpOutboundEndpoint.

  1. I don't understand what is the difference between RabbitTemplate and AmqpOutboundEndPoint since AmqpOutboundEndpoint is using an instance of RabbitTemplate.

  2. I would like to use an AMQP gateway to separate 2 different components of my application (Business component and Integration component) Is it valid to use an AqmpOutboundEndPoint to publish a message when i need to switch the routing key according to the published message type? All examples i found in internet are using a hardcoded routing key for the AMQP gateway.

Thanks

1

1 Answers

0
votes

Well, welcome to the Enterprise Integration Patterns

So, first of all you are right, AmqpOutboundEndpoint is really fully based on the RabbitTemplate because it is a good implementation for sending messages over AMQP.

On the other hand the endpoint is a Channel Adapter to receive messages via internal Integration channel.

So, you have to decide for yourself if you really need the whole Integration solution or just sending to the AMQP from your own code is enough.

That endpoint allows you to determine routingKey at runtime against requestMessage using SpEL.

See documentation on the matter: http://docs.spring.io/spring-integration/docs/4.3.11.RELEASE/reference/html/amqp.html#amqp-inbound-ack