littlersmall / rabbitmq-access Goto Github PK
View Code? Open in Web Editor NEWrabbitmq手动确认模式java封装
rabbitmq手动确认模式java封装
直接编译成一个jar包后,能在其他项目中使用吗?
<context:component-scan base-package="com.littlersmall.rabbitmqaccess"/>
看到需要配置这个。。。
如果业务逻辑落到数据库了,服务宕了,这个时候 ack 还未执行,消费者下线后别的消费者会重新消费此消息,这个问题请问有什么较好的解决方法。
你好,我在发送邮件的过程中用到了您文章中的发送确认机制,在一次性发送5000封的时候,突然服务器CPU爆了,根据堆栈文件分析是startRetry中Thread.sleep(Constants.RETRY_TIME_INTERVAL)睡眠一分钟,导致瞬间创建了几千个线程同时等待耗尽了CPU,这个地方我试图缩短了睡眠时间CPU还是很容易异常升高?这个有好的解决方案吗?
MQAccessBuilder : send message failed: clean channel shutdown; protocol method: #method<channel.close>(reply-code=406, reply-text=TIMEOUT WAITING FOR ACK, class-id=0, method-id=0)CorrelationData [id=19046]
如题
大神,MQAccessBuilder类中创建consumer使用QueueingConsumer,新版的rabbitmq已不支持这种用法,可以直接使用defaultConsumer创建?有没有其他影响
谢谢
像图上这样在PoolExample中添加setType(“topic”)但是一直报如下的错:
Caused by: com.rabbitmq.client.ShutdownSignalException: channel error; protocol method: #method<channel.close>(reply-code=406, reply-text=PRECONDITION_FAILED - inequivalent arg 'type' for exchange 'example' in vhost '/': received 'topic' but current is 'direct', class-id=40, method-id=10)
public class DetailRes {
boolean isSuccess;
String errMsg;
}
项目中多行使用构造方法均没有在DetailRes中出现
return new DetailRes(false, "");
我这边测试的效果是,consumer端打断点,不ack
请问这个是否我设置有问题?
QueueingConsumer在新版中已废弃,如何升级到新版本中
楼主,可以写一些test的例子?
例如 MQAccessBuilder中 buildMessageConsumer中, 163行使用了log
但根本没有初始化log.
为啥不是传入线程池,而是传那些线程池参数 然后在里面创建? 我觉得传入线程池更自由一点呢....万一我想用其他线程池。。那。。。。。
求方法
buildQueue方法里channel声明完交换器和队列后,为什么要channel.close()啊?比如在buildMessageConsumer里 channel可不可以直接给下面的MessageConsumer里获取消息使用呢?
作者您好,我看构造sender的时候,returnCallback的代码
rabbitTemplate.setReturnCallback(new ReturnCallback() {
@Override
public void returnedMessage(Message message,
int replyCode,
String replyText,
String exchange,
String routingKey) {
try {
Thread.sleep(Constants.ONE_SECOND);
} catch (InterruptedException e) {
e.printStackTrace();
}
log.error("send message failed: " + replyCode + " " + replyText);
rabbitTemplate.send(message);
}
});
中失败是直接调用send方法,这样做这次消息发送就没有关联操作了吧,只是单纯的发送,增加发送成功率用的,因为RetryCache中的map里还有并未删除,而且这次操作发送成功也不会从map中删除掉这条消息吧。另外一个问题就是,使用map做发送确认机制中的本地缓存看到简书上说到有宕机丢数据的危险,但是引入redis的话,还需要考虑redis的可用性,比如redis的稳定方面要考虑集群等,有点略重;关于缓存您有什么好的建议或者思路么?目前借鉴了你这个项目的思路在对rabbitmq进行简单封装
我想问,代码可以直接用于生产吗?刚开始以为是Jar包,引用就可以用,后来才发现是demo
你好,执行shutdown.sh不能关闭tomcat, 需要强制kill -9. 有没有好优化建议啊?
日志:
java.lang.IllegalStateException: Illegal access: this web application instance has been stopped already. Could not load [org.springframework.amqp.rabbit.connection.CachingConnectionFactory]. The following stack trace is thrown for debugging purposes as well as to attempt to terminate the thread which caused the illegal access.
如题
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.