Spring JmsTemplate Author: HuiFer 源码阅读仓库: SourceHot-spring 源码路径: org.springframework.jms.core.JmsTemplate 源码分析 send 发送消息 1 2 3 4 5 6 7 8 9 @Override public void send(final String destinationName, final MessageCreator messageCreator) throws JmsException { // 执行. execute(session -> { Destination destination = resolveDestinationName(session, destinationName); doSend(session, destination, messageCreator); return null; }, false); } 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 @Nullable public <T> T execute(SessionCallback<T> action, boolean startConnection) throws JmsException { Assert.notNull(action, "Callback object must not be null"); Connection conToClose = null; Session sessionToClose = null; try { Session sessionToUse = ConnectionFactoryUtils.doGetTransactionalSession( obtainConnectionFactory(), this.transactionalResourceFactory, startConnection); if (sessionToUse ==……
阅读全文