当前位置: 首页 > news >正文

专业做外贸英文公司网站建设工程造价管理总站网站

专业做外贸英文公司网站,建设工程造价管理总站网站,wordpress教育插件,网站改版协议http://activemq.apache.org/async-sends.html producer发送消息有同步和异步两种模式#xff0c;可以通过代码配置#xff1a; ((ActiveMQConnection)connection).setUseAsyncSend(true); producer默认是异步发送消息。在没有开启事务的情况下#xff0c;producer发送持久化…http://activemq.apache.org/async-sends.html producer发送消息有同步和异步两种模式可以通过代码配置 ((ActiveMQConnection)connection).setUseAsyncSend(true); producer默认是异步发送消息。在没有开启事务的情况下producer发送持久化消息是同步的调用send会阻塞直到broker把消息保存到磁盘并返回确认。 消息设置为持久 MessageProducer producer session.createProducer(destination); producer.setDeliveryMode(DeliveryMode.PERSISTENT); 消息设置为非持久 MessageProducer producer session.createProducer(destination); producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT); producer发送消息的调用栈如下 // ActiveMQSession protected void send(ActiveMQMessageProducer producer, ActiveMQDestination destination, Message message, int deliveryMode, int priority, long timeToLive,MemoryUsage producerWindow, int sendTimeout, AsyncCallback onComplete) throws JMSException {// 省略其他代码// 消息的持久类型和和连接模式是或的所以只要connection配置为异步就走异步发送if (onCompletenull sendTimeout 0 !msg.isResponseRequired() !connection.isAlwaysSyncSend() (!msg.isPersistent() || connection.isUseAsyncSend() || txid ! null)) {this.connection.asyncSendPacket(msg);if (producerWindow ! null) {int size msg.getSize();producerWindow.increaseUsage(size);}} else { // 同步发送if (sendTimeout 0 onCompletenull) {this.connection.syncSendPacket(msg,sendTimeout);}else {this.connection.syncSendPacket(msg, onComplete);}} }   producer发送同步消息的调用栈 // org.apache.activemq.transport.ResponseCorrelator public Object request(Object command) throws IOException {FutureResponse response asyncRequest(command, null);return response.getResult(); }public FutureResponse asyncRequest(Object o, ResponseCallback responseCallback) throws IOException {Command command (Command) o;command.setCommandId(sequenceGenerator.getNextSequenceId());// 需要回复command.setResponseRequired(true);FutureResponse future new FutureResponse(responseCallback);IOException priorError null;synchronized (requestMap) {priorError this.error;if (priorError null) {requestMap.put(new Integer(command.getCommandId()), future);}}if (priorError ! null) {future.set(new ExceptionResponse(priorError));throw priorError;}next.oneway(command);return future; }   producer发送异步消息的调用栈 //org.apache.activemq.transport.ResponseCorrelator public void oneway(Object o) throws IOException {Command command (Command)o;command.setCommandId(sequenceGenerator.getNextSequenceId());// 不需要回复command.setResponseRequired(false);next.oneway(command); }   在不考虑事务的情况下 producer发送持久化消息是同步发送发送是阻塞的直到收到确认。同步发送肯定是有流量控制的。 producer默认是异步发送异步发送不会等待broker的确认 所以就需要考虑流量控制了 ActiveMQConnectionFactory.setProducerWindowSize(int producerWindowSize) ProducerWindowSize的含义producer每发送一个消息统计一下发送的字节数当字节数达到ProducerWindowSize值时需要等待broker的确认才能继续发送。  转载于:https://www.cnblogs.com/allenwas3/p/8600638.html
http://www.pierceye.com/news/91671/

相关文章:

  • 搜索引擎排名网站北京到广州快递要几天
  • 制作网站怎么制作html网站 下载
  • 深圳网络营销网站设计做个网站哪里可以做
  • 九牛科技网站开发微信营销小型网站建设步骤
  • 分类信息系统网站模板口碑好的网站建设多少钱
  • 米粒网站建设网站开发项目费用预算
  • 12380网站建设的意见建议公司网站维护和更新属于哪个部门
  • 公众号做微网站吗做国外网站的站长
  • 现在网站优化app程序开发定制
  • 德阳网站怎么做seowordpress app 插件
  • 水文化建设网站网站排名优化公司哪家好
  • 网站图片的暗纹是怎么做的做家教中介 不建网站怎么做
  • 学校网站建设价格明细表淮安网站网站建设
  • 怎样做代刷网站长电子商务网站开发费用入账
  • 网站健设推广产品多少钱商业网站开发的实训小结怎么写
  • 优秀的网站建设推荐做百度推广是网站好还是阿里好
  • 响应式网站开发费用做不规则几何图形的网站
  • 西安网站建设优化集团门户网站建设不足
  • 深圳建网站的公企业做网站有什么用
  • wordpress插件 2017南宁seo排名外包
  • 在淘宝上开网店的详细步骤丹东网站seo
  • 网站建设外包公司招聘发帖子有哪些app平台
  • 网站风格发展趋势快设计
  • 稳定的网络建站咨询电话正规网站建设咨询电话
  • 请人代做谷歌外贸网站做购彩网站是怎么盈利的
  • 网站内链怎么删除wordpress如何下载
  • 深圳网站公司有了域名搭建网站详细步骤
  • 主机宝 建设网站怎么知道网站哪家公司做的
  • 1元做网站方案城乡建设住房建设厅官方网
  • 厦门网站网页设网页素材html