Comments (4)
meta在客户端事务类似,设置conn.setAutoCommit(false),及设置自动ack()为false
作用:不会将时间offest更新到zk,则下次启动后消费起点位置,仍和之前相同
在 2013年1月26日下午6:00,wangwei [email protected]写道:
看到介绍说,meta支持事务
动手配置的时候也看到system.ini部分有事务参数的配置实际编写java的producer部分,看到有事务支持的api
consumer部分没有相关事务支持或者ack相关的api,是否consumer层面不支持事务或者ack相关的特性?
btwl:consumer消费单条message,有没有超时的概念?
—
Reply to this email directly or view it on GitHubhttps://github.com//issues/29.
from metamorphosis.
因为meta是主动拉取消息,超时只会发生在 ‘去服务端拉取消息时’,当获取消息后的处理,没有超时的概念
from metamorphosis.
虽然没有超时的概念,但是有一个参数可以设置最大重试次数:
ConsumerConfig#setMaxFetchRetries
可以设置一条消息最多重试的次数,超过这个次数将跳过,并将消息存储到消费者所在的本地文件系统并自动重试。默认是5次。
Meta的消费者的事务,只针对一个分区有效,通过message.getPartition()获取partition对象,然后利用Partition的下列三个方法来控制事务:
/**
* 设置是否自动ack
*
* @param autoAck
* true表示自动ack
*/
public void setAutoAck(final boolean autoAck);
/**
* 应答本分区自上次应答以来收到的消息,meta客户端将递增offset,仅在设置autoAck为false的时候有效
*/
public void ack();
/**
* 回滚自上次应答以来收到的消息,meta将重试投递这些消息,仅在设置autoAck为false的时候有效
*/
public void rollback();
from metamorphosis.
事务的例子,在metamorphosis-example工程里有:
https://github.com/killme2008/metamorphosis-example
from metamorphosis.
Related Issues (20)
- 如何发送定时消息 HOT 1
- Query pending messages shows negative consumed messages
- 不停的创建新线程直至资源耗尽 HOT 5
- 关于consumer 安全消费的问题 HOT 1
- Spring配置共享订阅者方式中的问题
- Send message timeout时不能自动恢复的问题
- Metamorphosis 分布式事务支持 HOT 1
- Consumer消费失败问题
- Offset存储异常问题
- Offset存储Mysql异常问题
- 与Storm0.10集成出错
- zk每个两三天就会过期重连 HOT 2
- 发送消息的主题不能自定义吗? HOT 7
- MetaQ接收数据客户端进入死循环 HOT 2
- 这么通用的中间件,原码为何不用utf-8,而用GBK?造成编译很容易出问题。 HOT 3
- 是否支持一条消息多个消费点 同时消费
- 如何发送延时消息 HOT 1
- 图挂了 HOT 1
- Inconsistent library versions notice.
- 关于MessageConsumer shutdown的问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from metamorphosis.