本文整理汇总了Java中io.nats.client.MessageHandler类的典型用法代码示例。如果您正苦于以下问题:Java MessageHandler类的具体用法?Java MessageHandler怎么用?Java MessageHandler使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MessageHandler类属于io.nats.client包,在下文中一共展示了MessageHandler类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getMessageHandler
import io.nats.client.MessageHandler; //导入依赖的package包/类
protected MessageHandler getMessageHandler() {
return new MessageHandler() {
@Override
public void onMessage(Message m) {
R s = decodeData(m);
if (logger.isTraceEnabled()) {
logger.trace("Received by {} on Subject '{}' sharing Queue '{}': {}.", StandardNatsToSparkConnectorImpl.this, m.getSubject(), queue, s);
}
store(s);
}
};
}
示例2: getMessageHandler
import io.nats.client.MessageHandler; //导入依赖的package包/类
protected MessageHandler getMessageHandler() {
return new MessageHandler() {
@Override
public void onMessage(Message m) {
final Tuple2<String, V> s = decodeTuple(m);
if (logger.isTraceEnabled()) {
logger.trace("Received by {} on Subject '{}': {}.", StandardNatsToKeyValueSparkConnectorImpl.this, m.getSubject(), s);
}
store(s);
}
};
}
开发者ID:Logimethods,项目名称:nats-connector-spark,代码行数:15,代码来源:StandardNatsToKeyValueSparkConnectorImpl.java
示例3: createSubscription
import io.nats.client.MessageHandler; //导入依赖的package包/类
private SubscriptionImpl createSubscription(String subject, String qgroup,
io.nats.streaming.MessageHandler cb,
StreamingConnectionImpl conn,
SubscriptionOptions opts) {
return new SubscriptionImpl(subject, qgroup, cb, conn, opts);
}
示例4: subscribe
import io.nats.client.MessageHandler; //导入依赖的package包/类
@Override
public Subscription subscribe(String subject, io.nats.streaming.MessageHandler cb)
throws IOException, InterruptedException {
return subscribe(subject, cb, null);
}
示例5: getMessageHandler
import io.nats.client.MessageHandler; //导入依赖的package包/类
abstract protected MessageHandler getMessageHandler();