mq

WebSphere MQ and Atomikos - Messages Lost on process termination

匿名 (未验证) 提交于 2019-12-03 01:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: My app (a spring message listener) reads from a queue and writes to the database in a single transaction. I use Atomikos to provide the XA transaction behaviour. When the app is abruptly terminated with kill statements for example, I see messages are lost. Is there any specific configuration I need to use? Should the queues be persistent? Currently the queues are non-persistent. My MQ version is v7.1. Spring config for listener container looks like: <bean id = "listenerContainer" class = "com.miax.test.TestListenerMDPImpl" autowire

分布式事务解决方案及实现

爷,独闯天下 提交于 2019-12-03 01:17:19
一、事务的ACID原则   数据库事务的几个特性:原子性(Atomicity )、一致性( Consistency )、隔离性或独立性( Isolation)和持久性(Durabilily),简称就是ACID。 原子性:操作这些指令时,要么全部执行成功,要么全部不执行。只要其中一个指令执行失败,所有的指令都执行失败,数据进行回滚,回到执行指令前的数据状态。 一致性:事务的执行使数据从一个状态转换为另一个状态,但是对于整个数据的完整性保持稳定。 隔离性:在该事务执行的过程中,无论发生的任何数据的改变都应该只存在于该事务之中,对外界不存在任何影响。只有在事务确定正确提交之后,才会显示该事务对数据的改变。其他事务才能获取到这些改变后的数据。 持久性:当事务正确完成后,它对于数据的改变是永久性的。 二、什么是分布式事务   事务在单系统中的表现:多次数据库操作用事务进行管理,来保证ACID原则。            但是如果各个模块都是单独独立出来的微服务,进行了分布式部署,单系统里的事务将不能保证各个数据库操作的一致性,因此就需要分布式事务来进行统一管理。          三、分布式事务实现方案   现在的分布式事务实现方案有多种,有些已经被淘汰,如基于XA的两段式提交、TCC解决方案,还有本地消息表、MQ事务消息,还有一些开源的事务中间件,如LCN、GTS。   1

IBM WebSphere MQ request/reply scenario

匿名 (未验证) 提交于 2019-12-03 01:14:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm currently working on a project where I need to interface with an IBM system which communicates with the outside world through WebSphere MQ. I need to query the system in a "request-response" fashion using queues, and I will be doing this through a queue manager. However, I can't quite get my head around how this works in practical terms. Say I've got multiple instances of the same application which puts a message onto a request queue. The message gets a CorrelationId and MessageId upon leaving the application, and a ReplyToQueue property

Camel Transacted: MQ Session closed on every commit

匿名 (未验证) 提交于 2019-12-03 01:06:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have: Camel route (transacted=true), consuming from an MQ Queue Using Spring's WebSphereUowTransactionManager Transactionality works Running on IBM Liberty But, I get this message: Setup of JMS message listener invoker failed for destination 'MY.QUEUE' - trying to recover. Cause: Local JMS transaction failed to commit; nested exception is com.ibm.msg.client.jms.DetailedIllegalStateException: MQJCA1020: The session is closed. The application attempted to use a JMS session after it had closed the session. Modify the application so that it

How to resolve WebSphere MQ Reason code 2195 related error?

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am getting an WebSphere MQ Reason code 2195 MQRC_UNEXPECTED_ERROR when I try to connect to the message flows deployed on the execution group. Can somebody please tell me what exactly does this reason code mean? Queue manager, broker , execution group.. everything is up and running and the ports are also open. I am not getting anything worthwhile on the net. Please advise. 回答1: The 2195 return code is a high-level exception that is hit when errors are not caught at lower levels in the code. Very often these are generated when some external

find port number of IBM MQ Queue Manager

匿名 (未验证) 提交于 2019-12-03 01:00:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I have created a queue manager using these commands in a linux machine crtmqm MQ1 strmqm MQ1 runmqsc MQ1 the queue manager is created successfully, i wanted to know on which port is the queue manager MQ1 running, i tried all possible ways netstat -au and also ps -ef command. It looks like it is running on a different port. I am unable to find the correct port number where it is running, could anyone help? 回答1: Use netstat as root with -p option sudo netstat -nltp [sudo] password for root: Active Internet connections (only servers) Proto Recv

What is the latest WebSphere MQ Client version? [closed]

匿名 (未验证) 提交于 2019-12-03 00:46:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I'm seeing downloads for 7.0.1.8 off the IBM website but at the same time I see 7.1.0.1 around. I do not see the download for the client of 7.1.0.1 though... 回答1: The WMQ clients are available as SupportPacs . You can download one of the following: WMQ V7.0 Client == SupportPac MQC7 - Withdrawn no longer supported WMQ V7.1 Client == SupportPac MQC71 WMQ V7.5 Client == SupportPac MQC75 IBM MQ V8.0 Client == SupportPac MQC8 IBM MQ V9.0 Client == SupportPac MQC9 Be sure to use the Knowledge Center for the version of client you are using! WMQ V7

SpringMVC和rabbitmq集成使用

匿名 (未验证) 提交于 2019-12-03 00:39:02
1.添加maven依赖 < dependency > < groupId > com.rabbitmq </ groupId > < artifactId > amqp-client </ artifactId > < version > 3.5.1 </ version > </ dependency > < dependency > < groupId > org.springframework.amqp </ groupId > < artifactId > spring-rabbit </ artifactId > < version > 1.4.5.RELEASE </ version > </ dependency > 2.spring主配置文件中加入rabbitMQ xml文件的配置 <!-- rabbitMQ 配置 --> < import resource = "/application-mq.xml" /> 3.jdbc配置文件中加入 rabbitmq的链接配置 #rabbitMQ配置 mq.host=localhost mq.username=donghao mq.password=donghao mq.port=5672 mq.vhost=testMQ 4.新建application-mq.xml文件,添加配置信息 < beans xmlns = "http

RocketMQ之Pull消费者客户端启动

匿名 (未验证) 提交于 2019-12-03 00:30:01
Pull消费者客户端(主动拉取消息的消费者)即构造了DefaultMQPullConsumer对象,DefaultMQPullConsumer继承了ClientConfig类。我们先看其构造方法 public DefaultMQPullConsumer(final String consumerGroup, RPCHook rpcHook) { this.consumerGroup = consumerGroup; defaultMQPullConsumerImpl = new DefaultMQPullConsumerImpl(this, rpcHook); } 这里只是简单设置了consumerGroup消费者组名,表示消费者属于哪个组。构造了DefaultMQPullConsumerImpl的实例,DefaultMQPullConsumerImpl的构造方法很简单,只是绑定了DefaultMQPullConsumer、配置了传入的rpcHook。 DefaultMQPullConsumer内部封装了DefaultMQPullConsumerImpl,其中还维护这一些配置信息。这里维护着消费者订阅的topic集合。 private Set<String> registerTopics = new HashSet<String>(); 整个消费者客户端的启动

消息队列MQ使用场景

匿名 (未验证) 提交于 2019-12-03 00:27:02
硬盘的读写速度成为现代大数据量高并发模式下的瓶颈 。而 数据的访问往往遵循二八定律:80%的业务访问集中在20%的数据上,于是将这20%常用的数据写入内存(缓存)可以大大改善程序的运行速度 。 异步处理 和 应用解耦 。 异步处理 同步情况下 【如下图】:用户发出一个请求(下一个订单),要等待订单程序访问数据库扣减库存成功后,用户才能得到响应,在大量订单的情况下,数据库来不及处理,假设你前面已经有一万个订单在排队,每个订单处理需要0.02秒,那么一万个订单就是200秒,这个等待时间显然是不能承受的。 引入MQ的异步情况下 【如下图】:用户下订单后(下单之前一般会查询库存量是否>=购买量),直接返回下单成功,不做扣减库存的处理,而是将订单消息放入MQ储存起来,用户作为生产者,队列的另一端有异步程序在消费(即扣减库存),所以我们一般情况下会在购买东西之后几秒或者几分钟收到购买成功的短信,这个短信发送就是异步处理的。这样处理后,用户无需等待与自己无关的处理即可直接得到响应,让真正的操作在队列后台中默默的进行。 应用解耦 注意:在实际情况中,使用异步处理后,下单返回的消息可以是正在处理中等,一般不会直接将成功返回给用户,因为后续修改数据库等操作可能出现失败。所以会在所有的真正操作处理完成后,给用户发送一个下单成功的短信或邮件,避免纠纷。 文章来源: 消息队列MQ使用场景