BOS运维怎么下载旧版本

BOS运维怎么下载旧版本,第1张

通过旧版本号搜索下载。
首先我们需要在网站搜索下的旧版本号。然后需要找到对应的服务器,不同的版本对应的是不同,例如苹果和安卓版本不同。最后找到你想要的旧版本号下载即可。
哈罗bos系统手机app通过智能移动终端设备对所运维的设备设施进行基本信息的数据录入及日常维护工作,简化工作流程,实现主动的运维服务响应模式、可视化的流程监督管理、全面提升运维服务质量,为用户提供便捷的管理工具,确保用户在设备设施运维过程中的高效率和高品质。

// 采用手动应答 false 采用手动应答,true采用自动应答
boolean autoAck = false;
channelbasicConsume(QUEUE_NAME,autoAck,deliverCallback,cancelCallback);
然后,需要在接收消息的内部类中添加手动应答消息的tag(标记)
// 声明 接收消息
DeliverCallback deliverCallback = (consumerTag, message) ->{
//沉睡
SleepUtilssleep(30);
Systemoutprintln("接收到的消息:"+new String(messagegetBody(),"UTF-8"));
//手动应答
/
1、消息的标记 tag
2、是否批量应答 false 不批量应答 true 批量应答
/
channelbasicAck(messagegetEnvelope()getDeliveryTag(),false);
};
队列持久化
Channel channel = RabbitMqUtilsgetChannel();
// 声明队列
boolean durable = true; //queueDeclare 第二个参数 true 队列持久化 false 不持久化
channelqueueDeclare(QUEUE_NAME,durable,false,false,null);
//发消息
//String message = "hello world";
Scanner scanner = new Scanner(Systemin);
while (scannerhasNext()){
String message = scannernext();
channelbasicPublish("",QUEUE_NAME,null,messagegetBytes("UTF-8"));
Systemoutprintln("生产者发送的消息:"+message);
}
消息持久化
// 要想让消息实现持久化需要在消息生产者,添加MessagePropertiesPERSISTENT_TEXT_PLAIN这个属性
channelbasicPublish("",QUEUE_NAME, MessagePropertiesPERSISTENT_TEXT_PLAIN,messagegetBytes("UTF-8"));
不公平分发 和 预取值
最开始学习的是RabbitMQ轮询的方式来发消息,这种情况下并不是最好的,最好的应该是处理任务快的多发消息,处理任务慢的少发消息。我们可以在消费者接收消息之前设置参数channelbasicQos(1)来实现
int prefetchCount = 1;
channelbasicQos(prefetchCount);
发布确认模式
单个确认
public static void publishMessageIndividually() throws Exception{
Channel channel = RabbitMqUtilsgetChannel();
// 队列的声明
String queueName = UUIDrandomUUID()toString();
channelqueueDeclare(queueName,true,false,false,null);
// 开启发布确认
channelconfirmSelect();
// 开始时间
long begin = SystemcurrentTimeMillis();
// 批量发消息
for (int i = 0; i < MESSAGE_COUNT; i++) {
String message = i + "";
channelbasicPublish("",queueName,null,messagegetBytes());
// 单个消息就马上发布确认
boolean flag = channelwaitForConfirms();
if(flag){
Systemoutprintln("消息发送成功");
}
}
// 结束时间
long end = SystemcurrentTimeMillis();
Systemoutprintln("发布"+MESSAGE_COUNT+"个单独确认消息,耗时"+(end-begin)+"ms");
}
批量确认
public static void publishMessageBatch()throws Exception{
Channel channel = RabbitMqUtilsgetChannel();
// 队列的声明
String queueName = UUIDrandomUUID()toString();
channelqueueDeclare(queueName,true,false,false,null);
// 开启发布确认
channelconfirmSelect();
// 开始时间
long begin = SystemcurrentTimeMillis();
//批量确认消息的大小
int batchSize = 100;
//批量发送消息 并且批量发布确认
for (int i = 0; i < MESSAGE_COUNT; i++) {
String message = i + "";
channelbasicPublish("",queueName,null,messagegetBytes());
//判断批量消息达到100条的时候 批量确认一次
if(i % batchSize == 0){
channelwaitForConfirms();
}
}
// 结束时间
long end = SystemcurrentTimeMillis();
Systemoutprintln("发布"+MESSAGE_COUNT+"个批量确认消息,耗时"+(end-begin)+"ms");
}
异步确认
public static void publishMessageAsync() throws Exception{
Channel channel = RabbitMqUtilsgetChannel();
// 队列的声明
String queueName = UUIDrandomUUID()toString();
channelqueueDeclare(queueName,true,false,false,null);
// 开启发布确认
channelconfirmSelect();
/
线程安全的一个hash表,适用于高并发的情况下
1、轻松的将序号御消息进行关联
2、轻松批量删除条目,只要给到序号
3、支持高并发(多线程)
/
ConcurrentSkipListMap<Long,String> outStandingConfirms =
new ConcurrentSkipListMap<>();
// 消息确认成功 回调函数
ConfirmCallback ackCallback = (deliveryTag, mutiple) -> {
if(mutiple){ // 如果是批量确认
// 2、删除掉已经确认的消息,剩下就是未确认的消息
ConcurrentNavigableMap<Long, String> confirmed = outStandingConfirmsheadMap(deliveryTag);
confirmedclear();
}else{ // 如果不是批量确认
outStandingConfirmsremove(deliveryTag);
}
Systemoutprintln("确认的消息:"+deliveryTag);
};
// 消息确认失败 回调函数
ConfirmCallback nackCallback = (deliveryTag, mutiple) -> {
// 3、打印一下未确认的消息
String message = outStandingConfirmsget(deliveryTag);
Systemoutprintln("未确认的消息是"+message+"未确认的标记:"+deliveryTag);
};
// 准备消息监听器 监听哪些消息成功 哪些消息失败
channeladdConfirmListener(ackCallback,nackCallback);
// 开始时间
long begin = SystemcurrentTimeMillis();
for (int i = 0; i < MESSAGE_COUNT; i++) {
String message = i + "消息";
// 1、此处记录下所有要发送的消息,消息的总和
outStandingConfirmsput(channelgetNextPublishSeqNo(),message);
channelbasicPublish("",queueName,null,messagegetBytes());
}
// 结束时间
long end = SystemcurrentTimeMillis();
Systemoutprintln("发布"+MESSAGE_COUNT+"个异步发布确认消息,耗时"+(end-begin)+"ms");
}


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zz/13447849.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-08-08
下一篇 2023-08-08

发表评论

登录后才能评论

评论列表(0条)

保存