本文整理了Java中io.eventuate.tram.messaging.common.Message.hasHeader()
方法的一些代码示例,展示了Message.hasHeader()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.hasHeader()
方法的具体详情如下:
包路径:io.eventuate.tram.messaging.common.Message
类名称:Message
方法名:hasHeader
暂无
代码示例来源:origin: eventuate-tram/eventuate-tram-sagas
public void handleMessage(Message message) {
logger.debug("handle message invoked {}", message);
if (message.hasHeader(SagaReplyHeaders.REPLY_SAGA_ID)) {
handleReply(message);
} else {
logger.warn("Handle message doesn't know what to do with: {} ", message);
}
}
代码示例来源:origin: io.eventuate.tram.sagas/eventuate-jpa-sagas-framework
public void handleMessage(Message message) {
logger.debug("handle message invoked {}", message);
if (message.hasHeader(SagaReplyHeaders.REPLY_SAGA_ID)) {
handleReply(message);
} else if (message.hasHeader(EventMessageHeaders.EVENT_TYPE)) {
String aggregateType = message.getRequiredHeader(EventMessageHeaders.AGGREGATE_TYPE);
String aggregateId = message.getRequiredHeader(Message.PARTITION_ID);
String eventType = message.getRequiredHeader(EventMessageHeaders.EVENT_TYPE);
// TODO query the saga event routing table: (at, aId, et) -> [(sagaType, sagaId)]
for (SagaTypeAndId sagaTypeAndId : aggregateInstanceSubscriptionsDAO.findSagas(aggregateType, aggregateId, eventType)) {
handleAggregateInstanceEvent(sagaTypeAndId.getSagaType(), sagaTypeAndId.getSagaId(), message, aggregateType, aggregateId, eventType);
}
;
} else {
logger.warn("Handle message doesn't know what to do with: {} ", message);
}
}
内容来源于网络,如有侵权,请联系作者删除!