concept send() in category spring

This is an excerpt from Manning's book Spring in Action, Fifth Edition.
As you can see, there are really only two methods, send() and convertAndSend(), each overridden to support different parameters. And if you look closer, you’ll notice that the various forms of convertAndSend() can be broken into two subcategories. In trying to understand what all of these methods do, consider the following breakdown:
Three send() methods require a MessageCreator to manufacture a Message object.
If this Destination bean is injected into JmsOrderMessagingService, you can use it to specify the destination when calling send():
private Destination orderQueue; @Autowired public JmsOrderMessagingService(JmsTemplate jms, Destination orderQueue) { this.jms = jms; this.orderQueue = orderQueue; } ... @Override public void sendOrder(Order order) { jms.send( orderQueue, session -> session.createObjectMessage(order)); }Specifying the destination with a Destination object like this affords you the opportunity to configure the Destination with more than just the destination name. But in practice, you’ll almost never specify anything more than the destination name. It’s often easier to just send the name as the first parameter to send():
@Override public void sendOrder(Order order) { jms.send( "tacocloud.order.queue", session -> session.createObjectMessage(order)); }Although the send() method isn’t particularly difficult to use (especially when the MessageCreator is given as a lambda), a sliver of complexity is added by requiring that you provide a MessageCreator. Wouldn’t it be simpler if you only needed to specify the object that’s to be sent (and optionally the destination)? That describes succinctly how convertAndSend() works. Let’s take a look.