JmsTemplate sendAndReceive 设置超时

通过调用sendAndReceive方法,实现发送消息之后可以同步接收返回信息。

Message replyMsg = this.jmsQueueTemplate.sendAndReceive(new MessageCreator(){@Overridepublic Message createMessage(Session sn) throws JMSException {TextMessage txtMsg = sn.createTextMessage(msg);return txtMsg;}});

  

在消息处理端,有可能存在处理比较耗时的操作,为了防止客户端长时间没有接收到处理结果信息,可以通过:

this.jmsQueueTemplate.setReceiveTimeout(3000);

设置超时时间,如果超过此时间,消息发送方没有接收到处理消息则提示用户超时。

 

转载于:https://www.cnblogs.com/yshyee/p/9391268.html

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/279732.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

亚信科技数据库AntDB通过金融分布式事务数据库标准测试

近日,南京, 中国信息通信研究院云计算与大数据研究所(以下简称“中国信通院云大所”)组织专家对亚信科技(股票代码:01675.HK)的数据库产品AISWare AntDB(以下简称“AntDB”),进行了金融分布式事务数据库标准测试,所有功能顺利通过测试。该测试的通过充分彰显了亚信科技AntDB是一…

安装sql2012 需要安装net3.5 没有的话 安装不成功

Error while enabling Windows feature : NetFx3, Error Code : -2146498298 在 Windows 8 或 Windows Server 2012 中安装 .NET Framework 3.5 时出现错误代码:0x800F0906 winx 管理员权限 打开cmd命令提示符处,运行下面的命令: Dism /onl…

instagram发布工具_如何在不发布照片的情况下保存已编辑的Instagram照片

instagram发布工具Unfortunately, there’s no built-in method for saving your edited Instagram photos without posting them first. However, with this neat trick, you can add Instagram filters to your photos and save them locally to your phone without actually…

Verify the Developer App certificate for your account is trusted on your device.

1、报错内容 Could not launch “CH5203” Verify the Developer App certificate for your account is trusted on your device. Open Settings on 测试 and navigate to General -> Device Management, then select your Developer App certificate to trust it. 2、解决方…

HTTP2和HTTPS来不来了解一下?

一、前言 只有光头才能变强 HTTP博文回顾: PC端:HTTP就是这么简单PC端:HTTP面试题都在这里微信公众号端:HTTP就是这么简单微信公众号端:HTTP面试题都在这里本文力求简单讲清每个知识点,希望大家看完能有所收…

apple默认备份位置_如何将Apple Maps默认设置为步行路线

apple默认备份位置The default mode of transportation in Apple Maps is set to driving, but with a simple tweak, you can adjust your Apple Maps experience to default to the mode you use most. Apple Maps中的默认交通方式设置为行车,但是通过简单的调整&…

php 面向对象

1类的创建 class创建类 class Person{} 2.对象的创建 使用new关键字 class Person{} $p1new Person 3.成员的添加 添加成员需要 三个修饰符 public 公开的 定义公共的属性和方法,类的外部,类的内部,子类都可以使用 protected 受保护的 定义…

apache 404\403错误页面跳转

1、全局下使用404跳转 在httpd.conf下配置跳转 1vim /usr/local/httpd/conf/httpd.conf 123456<Directory "/usr/local/httpd-2.4.25/htdocs"> AllowOverride None Require all granted ErrorDocument 404 /aa.jpg #配置跳转页面&#xff0c;注意aa文件必须在…

JS实现千分位

方法一&#xff1a;正则实现 function format (num) { var reg/\d{1,3}(?(\d{3})$)/g; return (num ).replace(reg, $&,); } 解释&#xff1a; 1、正则表达式 \d{1,3}(?(\d{3})$) 表示前面有1~3个数字&#xff0c;后面的至少由一组3个数字结尾 2、?表示正向引用&…

白色裤子为什么会沾上蓝色_什么是蓝色的,为什么它可以在Mac上运行?

白色裤子为什么会沾上蓝色You’re looking through Activity Monitor when you notice a process called blued. Should you be worried that this is running? No: it’s the process that powers Bluetooth on your Mac. 当您发现一个名为blued的进程时&#xff0c;您正在浏…

ThreadLocal源码剖析

。。转载于:https://www.cnblogs.com/Joy-Hu/p/10677434.html

Linux移植之内核启动过程引导阶段分析

在Linux移植之make uImage编译过程分析中已经提到了uImage是一个压缩的包并且内含压缩程序&#xff0c;可以进行自解压。自解压完成之后内核代码从物理地址为0x30008000处开始运行。下面分析在进入C之前内核做的一些工作&#xff0c;以下是内核启动过程中打印出来的信息&#x…

阿里开源HTML5小游戏开发框架Hilo实战教程

前言 开发基于Html5的小游戏并不困难&#xff0c;基本思路就是使用Html5的canvas进行游戏图像绘制&#xff0c;通过监听Dom元素的touch事件并触发相应的动画&#xff0c;来实现游戏的交互。难在于解决开发后面临的不同设备游戏画面、音效等兼容性问题。 使用Hilo可以帮助我们解…

outlook附件大小限制_如何在Outlook中调整大图片附件的大小

outlook附件大小限制When you have to send someone a large image file through email, it’s a good idea to resize the image file to make it smaller before sending it. Outlook makes this easy and allows you to resize the image file as it’s sent. 当您必须通过电…

bzoj2460: [BeiJing2011]元素

怕不是学了个假的线性基。。。一直以为要高位到低位插入&#xff0c;结果那个是高斯消元的线性基。。。 那么直接排序权值就行了。 #include<cstdio> #include<iostream> #include<cstring> #include<cstdlib> #include<algorithm> #include<…

西湖论剑WP

先水几句&#xff0c;这次的题确实难啊&#xff0c;动用洪荒之力了&#xff0c;第一名的神仙也没有全部做完。 官方说这次的题目有两道没被做出来&#xff0c;我猜应该是PWN和RE吧 本来我们是45名的&#xff0c;最后5分钟那帮人啊&#xff0c;硬生生给我们挤出前50&#xff0c;…

vm macos 启用3d_如何在macOS中启用夜班以减轻眼睛疲劳

vm macos 启用3dNight Shift is a new feature introduced in macOS Sierra 10.12.4, and you might already be familiar with it if you’re an iOS user. Here’s how to enable it and set it up on your Mac. Night Shift是macOS Sierra 10.12.4中引入的新功能&#xff0c…

hdu3072 Intelligence System (最小树形图?)

题意&#xff1a;给一个有向图&#xff0c;问要从0号点能到达所有点所需要经过路径的最小权值和是多少&#xff0c;然而&#xff0c;若两点强联通&#xff0c;则这两点互相到达不需要花费。保证0号点能到达所有点 tarjan缩点以后直接取每个点入边中花费最小的即可。 1 #include…

如何在Windows 7、8、10,Vista或XP中删除Windows服务

If you are a fan of tweaking your system and disabling services, you might find that over time your Windows Services list becomes large and unwieldy. It’s easy enough to delete a Windows service using the Command Prompt. 如果您喜欢调整系统并禁用服务&#…

缩点(有向图的强连通分量)学习笔记

缩点(有向图的强连通分量)学习笔记 1.什么是强连通分量&#xff1f;&#xff1a; 有向图强连通分量:在有向图G中&#xff0c;如果两个顶点vi,vj间(vi>vj)有一条从vi到vj的有向路径&#xff0c;同时还有一条从vj到vi的有向路径&#xff0c;则称两个顶点强连通(strongly conne…