本文整理汇总了Java中javax.jms.TextMessage.setLongProperty方法的典型用法代码示例。如果您正苦于以下问题:Java TextMessage.setLongProperty方法的具体用法?Java TextMessage.setLongProperty怎么用?Java TextMessage.setLongProperty使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javax.jms.TextMessage
的用法示例。
在下文中一共展示了TextMessage.setLongProperty方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: publishCiStateMessage
import javax.jms.TextMessage; //导入方法依赖的package包/类
/**
* Publish ci state message.
*
* @param event the event
*/
public void publishCiStateMessage(CiChangeStateEvent event) {
try {
TextMessage message = session.createTextMessage(gson.toJson(event));
message.setLongProperty("ciId", event.getCiId());
message.setStringProperty("type", "ci-change-state");
message.setStringProperty("ciState", event.getNewState());
producer.send(message);
logger.info("Published: ciId:" + event.getCiId());
logger.info(message.getText());
} catch (JMSException e) {
// TODO see if we can put some durability here
logger.error("caught Exception publishing",e);
}
}
示例2: publishMonitor
import javax.jms.TextMessage; //导入方法依赖的package包/类
private void publishMonitor(MonitorRequest mr) throws SensorClientException {
try {
TextMessage message = null;
message = session.createTextMessage(gson.toJson(mr));
message.setStringProperty(MSG_TYPE, MSG_TYPE_MONITOR);
message.setLongProperty(MSG_PROP_MANIFEST_ID, mr.getManifestId());
message.setLongProperty(MSG_PROP_CI_ID, mr.getCiId());
producer.send(message);
logger.info("Published: monitor for ciId:" + mr.getCiId() + "; manifestId:" + mr.getManifestId() + "; action:" + mr.getAction());
logger.debug(message.getText());
} catch (JMSException e) {
logger.error("caught Exception publishing",e);
throw new SensorClientException(e);
}
}