??xml version="1.0" encoding="utf-8" standalone="yes"?>BlogJava-所有随W区http://www.qpkxbc.shop/all专注于Java技?/description>zh-cnSat, 21 Mar 2020 19:15:00 GMTSat, 21 Mar 2020 19:15:00 GMT60solaris11.4http://www.qpkxbc.shop/waterjava/archive/2020/03/21/435291.html狼爱上狸狼爱上狸Sat, 21 Mar 2020 13:43:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/21/435291.htmlhttp://www.qpkxbc.shop/waterjava/comments/435291.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/21/435291.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435291.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435291.htmlhttps://www.oracle.com/solaris/solaris11/downloads/solaris11-vm-templates-downloads.html

狼爱上狸 2020-03-21 21:43 发表评论
]]>
开机nfs自动挂蝲http://www.qpkxbc.shop/paulwong/archive/2020/03/21/435290.htmlpaulwongpaulwongSat, 21 Mar 2020 11:44:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/21/435290.htmlhttp://www.qpkxbc.shop/paulwong/comments/435290.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/21/435290.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435290.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435290.htmlQ.echo "mount -t nfs -o nolock ${IP}:${remote_dir} ${local_dir}" >>  /etc/rc.local

Q.echo "${IP}:/home/logs /home/logs nfs defaults 0 0" >> /etc/fstab

关于/etc/rc.local


rc.local也是我经怋用的一个脚本。该脚本是在pȝ初始化别脚本运行之后再执行的,因此可以安全地在里面d你想在系l启动之后执行的脚本。常见的情况是你可以再里面添加nfs挂蝲/mount脚本。此外,你也可以在里面添加一些调试用的脚本命令。例如,我就到q这U情况:samba服务L无法正常q行Q而检查发玎ͼsamba是在pȝ启动q程中就该启动执行的Q也是_samba守护E序配置保证了这U功能本应该正确执行。碰到这U类似情况,一般我也懒得花大量旉LZ么,我只需要简单的?etc/rc.local脚本里加上这么一行:

/etc/init.d/samba start

q样成功的解决了samba服务异常的问题?img src ="http://www.qpkxbc.shop/paulwong/aggbug/435290.html" width = "1" height = "1" />

paulwong 2020-03-21 19:44 发表评论
]]>
利用 Chef ?Red Hat Enterprise Linux 上自动化部v Mariadb Galera Clusterhttp://www.qpkxbc.shop/paulwong/archive/2020/03/21/435289.htmlpaulwongpaulwongSat, 21 Mar 2020 02:55:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/21/435289.htmlhttp://www.qpkxbc.shop/paulwong/comments/435289.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/21/435289.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435289.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435289.htmlhttps://www.ibm.com/developerworks/cn/linux/1611_chensz_mgc/index.html



paulwong 2020-03-21 10:55 发表评论
]]>
solaris11.3下蝲http://www.qpkxbc.shop/waterjava/archive/2020/03/20/435288.html狼爱上狸狼爱上狸Fri, 20 Mar 2020 13:52:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/20/435288.htmlhttp://www.qpkxbc.shop/waterjava/comments/435288.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/20/435288.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435288.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435288.htmlhttp://download.oracle.com/otn/solaris/11_3/sol-11_3-vbox.ova

狼爱上狸 2020-03-20 21:52 发表评论
]]>
linuxQcentos7Q安装jdk8--附带oracle账号http://www.qpkxbc.shop/waterjava/archive/2020/03/20/435287.html狼爱上狸狼爱上狸Fri, 20 Mar 2020 10:53:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/20/435287.htmlhttp://www.qpkxbc.shop/waterjava/comments/435287.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/20/435287.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435287.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435287.html

狼爱上狸 2020-03-20 18:53 发表评论
]]>
POI操作Excelhttp://www.qpkxbc.shop/tjyhy590/archive/2020/03/20/435285.html鸉K鸉KFri, 20 Mar 2020 02:13:00 GMThttp://www.qpkxbc.shop/tjyhy590/archive/2020/03/20/435285.htmlhttp://www.qpkxbc.shop/tjyhy590/comments/435285.htmlhttp://www.qpkxbc.shop/tjyhy590/archive/2020/03/20/435285.html#Feedback0http://www.qpkxbc.shop/tjyhy590/comments/commentRss/435285.htmlhttp://www.qpkxbc.shop/tjyhy590/services/trackbacks/435285.html org.apache.poi poi 3.17 注:3.17版本是支持jdk6的最后版? 二、HSSF概况   HSSF 是Horrible SpreadSheet Format的羃写,通过HSSFQ你可以用纯Java代码来读取、写入、修改Excel文g。HSSF 取操作提供了两类APIQusermodel和eventusermodelQ即“用户模型”?#8220;事g-用户模型”? 三?POI EXCEL文档l构c? HSSFWorkbook excel文档对象 HSSFSheet excel的sheet HSSFRow excel的行 HSSFCell excel的单元格 HSSFFont excel字体 HSSFName 名称 HSSFDataFormat 日期格式 HSSFHeader sheet? HSSFFooter sheet? HSSFCellStyle cell样式 HSSFDateUtil 日期 HSSFPrintSetup 打印 HSSFErrorConstants 错误信息? 四、EXCEL的读写操? 1、读?#8220;区域数据.xls”q储存于list集合中,“区域数据.xls”如下? public List importXLS(){ ArrayList list = new ArrayList<>(); try {      //1、获取文件输入流      InputStream inputStream = new FileInputStream("/Users/Shared/区域数据.xls");      //2、获取Excel工作对? HSSFWorkbook workbook = new HSSFWorkbook(inputStream);      //3、得到Excel工作表对? HSSFSheet sheetAt = workbook.getSheetAt(0); //4、@环读取表格数?      for (Row row : sheetAt) {        //首行Q即表头Q不d if (row.getRowNum() == 0) { continue; } //d当前行中单元格数据,索引?开?        String areaNum = row.getCell(0).getStringCellValue(); String province = row.getCell(1).getStringCellValue(); String city = row.getCell(2).getStringCellValue(); String district = row.getCell(3).getStringCellValue(); String postcode = row.getCell(4).getStringCellValue(); Area area = new Area(); area.setCity(city); area.setDistrict(district); area.setProvince(province);        area.setPostCode(postcode); list.add(area); }      //5、关闭流 workbook.close(); } catch (IOException e) { e.printStackTrace(); }   return list; } 2、导出数据到“区域数据.xls”文g中,面数据如下图: public void exportExcel() throws IOException { Page page = areaService.pageQuery(null); List list = page.getContent(); //1.在内存中创徏一个excel文g HSSFWorkbook hssfWorkbook = new HSSFWorkbook(); //2.创徏工作? HSSFSheet sheet = hssfWorkbook.createSheet(); //3.创徏标题? HSSFRow titlerRow = sheet.createRow(0); titlerRow.createCell(0).setCellValue("?); titlerRow.createCell(1).setCellValue("?); titlerRow.createCell(2).setCellValue("?); titlerRow.createCell(3).setCellValue("邮编"); titlerRow.createCell(4).setCellValue("?); titlerRow.createCell(5).setCellValue("城市~码"); //4.遍历数据,创徏数据? for (Area area : list) { //获取最后一行的行号 int lastRowNum = sheet.getLastRowNum(); HSSFRow dataRow = sheet.createRow(lastRowNum + 1); dataRow.createCell(0).setCellValue(area.getProvince()); dataRow.createCell(1).setCellValue(area.getCity()); dataRow.createCell(2).setCellValue(area.getDistrict()); dataRow.createCell(3).setCellValue(area.getPostcode()); dataRow.createCell(4).setCellValue(area.getShortcode()); dataRow.createCell(5).setCellValue(area.getCitycode()); } //5.创徏文g? String fileName = "区域数据l计.xls"; //6.获取输出对? HttpServletResponse response = ServletActionContext.getResponse(); ServletOutputStream outputStream = response.getOutputStream(); //7.获取mimeType ServletContext servletContext = ServletActionContext.getServletContext(); String mimeType = servletContext.getMimeType(fileName); //8.获取览器信?Ҏ件名q行重新~码 HttpServletRequest request = ServletActionContext.getRequest(); fileName = FileUtils.filenameEncoding(fileName, request); //9.讄信息? response.setContentType(mimeType); response.setHeader("Content-Disposition","attachment;filename="+fileName); //10.写出文g,关闭? hssfWorkbook.write(outputStream); hssfWorkbook.close(); } 工具c? public class FileUtils { public static String filenameEncoding(String filename, HttpServletRequest request) throws IOException { String agent = request.getHeader("User-Agent"); //获取览? if (agent.contains("Firefox")) { BASE64Encoder base64Encoder = new BASE64Encoder(); filename = "=?utf-8?B?" + base64Encoder.encode(filename.getBytes("utf-8")) + "?="; } else if(agent.contains("MSIE")) { filename = URLEncoder.encode(filename, "utf-8"); } else if(agent.contains ("Safari")) { filename = new String (filename.getBytes ("utf-8"),"ISO8859-1"); } else { filename = URLEncoder.encode(filename, "utf-8"); } return filename; } } 写出xls文gQ? 五?EXCEL常用操作Ҏ 1?得到Excel常用对象 POIFSFileSystem fs=newPOIFSFileSystem(new FileInputStream("d:/test.xls")); //得到Excel工作对? HSSFWorkbook wb = new HSSFWorkbook(fs); //得到Excel工作表对? HSSFSheet sheet = wb.getSheetAt(0); //得到Excel工作表的? HSSFRow row = sheet.getRow(i); //得到Excel工作表指定行的单元格 HSSFCell cell = row.getCell((short) j); cellStyle = cell.getCellStyle();//得到单元格样? 2、徏立Excel常用对象 HSSFWorkbook wb = new HSSFWorkbook();//创徏Excel工作对? HSSFSheet sheet = wb.createSheet("new sheet");//创徏Excel工作表对? HSSFRow row = sheet.createRow((short)0); //创徏Excel工作表的? cellStyle = wb.createCellStyle();//创徏单元格样? row.createCell((short)0).setCellStyle(cellStyle); //创徏Excel工作表指定行的单元格 row.createCell((short)0).setCellValue(1); //讄Excel工作表的? 3、设|sheet名称和单元格内容 wb.setSheetName(1, "W一张工作表",HSSFCell.ENCODING_UTF_16); cell.setEncoding((short) 1); cell.setCellValue("单元格内?); 4、取得sheet的数? wb.getNumberOfSheets() 5?Ҏindex取得sheet对象 HSSFSheet sheet = wb.getSheetAt(0); 6、取得有效的行数 int rowcount = sheet.getLastRowNum(); 7、取得一行的有效单元g? row.getLastCellNum(); 8、单元格值类型读? cell.setCellType(HSSFCell.CELL_TYPE_STRING); //讄单元gؓSTRINGcd cell.getNumericCellValue();//d为数值类型的单元格内? 9、设|列宽、行? sheet.setColumnWidth((short)column,(short)width); row.setHeight((short)height); 10、添加区域,合ƈ单元? Region region = new Region((short)rowFrom,(short)columnFrom,(short)rowTo ,(short)columnTo);//合ƈ从第rowFrom行columnFrom? sheet.addMergedRegion(region);// 到rowTo行columnTo的区? //得到所有区? sheet.getNumMergedRegions() 11、保存Excel文g FileOutputStream fileOut = new FileOutputStream(path); wb.write(fileOut); 12、根据单元格不同属性返回字W串数? public String getCellStringValue(HSSFCell cell) {   String cellValue = "";   switch (cell.getCellType()) {     case HSSFCell.CELL_TYPE_STRING://字符串类?         cellValue = cell.getStringCellValue();         if(cellValue.trim().equals("")||cellValue.trim().length()<=0)           cellValue=" ";         break;     case HSSFCell.CELL_TYPE_NUMERIC: //数值类?         cellValue = String.valueOf(cell.getNumericCellValue());         break;     case HSSFCell.CELL_TYPE_FORMULA: //公式         cell.setCellType(HSSFCell.CELL_TYPE_NUMERIC);         cellValue = String.valueOf(cell.getNumericCellValue());         break;     case HSSFCell.CELL_TYPE_BLANK:         cellValue=" ";         break;     case HSSFCell.CELL_TYPE_BOOLEAN:         break;     case HSSFCell.CELL_TYPE_ERROR:         break;     default:         break;   }   return cellValue; } 13、常用单元格Ҏ格式 HSSFCellStyle style = wb.createCellStyle(); style.setBorderBottom(HSSFCellStyle.BORDER_DOTTED);//下边? style.setBorderLeft(HSSFCellStyle.BORDER_DOTTED);//左边? style.setBorderRight(HSSFCellStyle.BORDER_THIN);//双? style.setBorderTop(HSSFCellStyle.BORDER_THIN);//上边? 14、设|字体和内容位置 HSSFFont f = wb.createFont(); f.setFontHeightInPoints((short) 11);//字号 f.setBoldweight(HSSFFont.BOLDWEIGHT_NORMAL);//加粗 style.setFont(f); style.setAlignment(HSSFCellStyle.ALIGN_CENTER);//左右居中 style.setVerticalAlignment(HSSFCellStyle.VERTICAL_CENTER);//上下居中 style.setRotation(short rotation);//单元格内容的旋{的角? HSSFDataFormat df = wb.createDataFormat(); style1.setDataFormat(df.getFormat("0.00%"));//讄单元格数据格? cell.setCellFormula(string);//l单元格讑օ? style.setRotation(short rotation);//单元格内容的旋{的角? 15、插入图? //先把读进来的囄攑ֈ一个ByteArrayOutputStream中,以便产生ByteArray ByteArrayOutputStream byteArrayOut = new ByteArrayOutputStream(); BufferedImage bufferImg = ImageIO.read(new File("ok.jpg")); ImageIO.write(bufferImg,"jpg",byteArrayOut); //读进一个excel模版 FileInputStream fos = new FileInputStream(filePathName+"/stencil.xlt"); fs = new POIFSFileSystem(fos); //创徏一个工作薄 HSSFWorkbook wb = new HSSFWorkbook(fs); HSSFSheet sheet = wb.getSheetAt(0); HSSFPatriarch patriarch = sheet.createDrawingPatriarch(); HSSFClientAnchor anchor = new HSSFClientAnchor(0,0,1023,255,(short) 0,0,(short)10,10); patriarch.createPicture(anchor , wb.addPicture(byteArrayOut.toByteArray(),HSSFWorkbook.PICTURE_TYPE_JPEG)); 16、调整工作表位置 HSSFWorkbook wb = new HSSFWorkbook(); HSSFSheet sheet = wb.createSheet("format sheet"); HSSFPrintSetup ps = sheet.getPrintSetup(); sheet.setAutobreaks(true); ps.setFitHeight((short)1); ps.setFitWidth((short)1);

鸉K 2020-03-20 10:13 发表评论
]]>
docker 安装 registryhttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/19/435282.html杨军?/dc:creator>杨军?/author>Thu, 19 Mar 2020 10:17:00 GMThttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/19/435282.htmlhttp://www.qpkxbc.shop/yangjunwei/comments/435282.htmlhttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/19/435282.html#Feedback0http://www.qpkxbc.shop/yangjunwei/comments/commentRss/435282.htmlhttp://www.qpkxbc.shop/yangjunwei/services/trackbacks/435282.html2、在registry中新建docker-compose.yml文gQ编辑此文g
version: '3.1'
services:
 registry:
  image: registry:2.7.1
  restart: always
  container_name: registry
  ports:
   - 5000:5000
  volumes:
   - /usr/local/docker/registry/data:/var/lib/registry
 frontend:
    image: konradkleine/docker-registry-frontend:v2
    ports:
      - 8080:80
    volumes:
      - ./certs/frontend.crt:/etc/apache2/server.crt:ro
      - ./certs/frontend.key:/etc/apache2/server.key:ro
    environment:
      - ENV_DOCKER_REGISTRY_HOST=192.168.1.8
      - ENV_DOCKER_REGISTRY_PORT=5000
3.q行 docker-compose up
4.上传镜像
docker tag tomcat 192.168.1.8:5000/tomcat:8.1
 docker push 192.168.1.8:5000/tomcat:8.1


]]>
IM消息ID技术专??Q开源分布式ID生成器UidGenerator的技术实?/title><link>http://www.qpkxbc.shop/jb2011/archive/2020/03/19/435281.html</link><dc:creator>Jack Jiang</dc:creator><author>Jack Jiang</author><pubDate>Thu, 19 Mar 2020 09:34:00 GMT</pubDate><guid>http://www.qpkxbc.shop/jb2011/archive/2020/03/19/435281.html</guid><wfw:comment>http://www.qpkxbc.shop/jb2011/comments/435281.html</wfw:comment><comments>http://www.qpkxbc.shop/jb2011/archive/2020/03/19/435281.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/jb2011/comments/commentRss/435281.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/jb2011/services/trackbacks/435281.html</trackback:ping><description><![CDATA[     摘要: 1、引a很多Z惛_IM应用开发,W一印象是“长连?#8221;?#8220;socket”?#8220;保活”?#8220;协议”q些关键词,没错Q这些确实是IM开发中肯定会涉及的技术范畴。但Q当你真正开始编写第一行代码时Q最现实的问题实际上?#8220;聊天消息ID该怎么生成Q?#8221;q个看似微不道的小事情。说它看似微不道,...  <a href='http://www.qpkxbc.shop/jb2011/archive/2020/03/19/435281.html'>阅读全文</a><img src ="http://www.qpkxbc.shop/jb2011/aggbug/435281.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/jb2011/" target="_blank">Jack Jiang</a> 2020-03-19 17:34 <a href="http://www.qpkxbc.shop/jb2011/archive/2020/03/19/435281.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Flutter 常用框架http://www.qpkxbc.shop/waterjava/archive/2020/03/19/435280.html狼爱上狸狼爱上狸Thu, 19 Mar 2020 09:10:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/19/435280.htmlhttp://www.qpkxbc.shop/waterjava/comments/435280.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/19/435280.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435280.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435280.htmlhttps://www.jianshu.com/p/7403371162c1

狼爱上狸 2020-03-19 17:10 发表评论
]]>
docker 安装MySQLhttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/19/435279.html杨军?/dc:creator>杨军?/author>Thu, 19 Mar 2020 05:29:00 GMThttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/19/435279.htmlhttp://www.qpkxbc.shop/yangjunwei/comments/435279.htmlhttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/19/435279.html#Feedback0http://www.qpkxbc.shop/yangjunwei/comments/commentRss/435279.htmlhttp://www.qpkxbc.shop/yangjunwei/services/trackbacks/435279.htmlversion: '3.1' services: mysql: restart: always image: mysql:5.7.22 container_name: mysql ports: - 3306:3306 environment: TZ: Asia/Shanghai MYSQL_ROOT_PASSWORD: 123456 command: --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1 --max_allowed_packet=128M --sql-mode="STRICT_TRANS_TABLES,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO" volumes: - mysql-data:/var/lib/mysql volumes: mysql-data:

version: '3.1' services: db: image: mysql restart: always environment: MYSQL_ROOT_PASSWORD: 123456 command: --default-authentication-plugin=mysql_native_password --character-set-server=utf8mb4 --collation-server=utf8mb4_general_ci --explicit_defaults_for_timestamp=true --lower_case_table_names=1 ports: - 3306:3306 volumes: - ./data:/var/lib/mysql adminer: image: adminer restart: always ports: - 8080:8080

]]>
在SPRING BOOT中用多JMS CONNECTIONhttp://www.qpkxbc.shop/paulwong/archive/2020/03/19/435278.htmlpaulwongpaulwongThu, 19 Mar 2020 01:45:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/19/435278.htmlhttp://www.qpkxbc.shop/paulwong/comments/435278.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/19/435278.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435278.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435278.html
ActiveMQConnectionFactoryFactory.java
import java.lang.reflect.InvocationTargetException;
import java.util.Collections;
import java.util.List;

import org.apache.activemq.ActiveMQConnectionFactory;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQConnectionFactoryCustomizer;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQProperties;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQProperties.Packages;
import org.springframework.util.Assert;
import org.springframework.util.StringUtils;


/**
 * Factory to create a {
@link ActiveMQConnectionFactory} instance from properties defined
 * in {
@link SecondaryActiveMQProperties}.
 *
 * 
@author Phillip Webb
 * 
@author Venil Noronha
 
*/
class ActiveMQConnectionFactoryFactory {

    private static final String DEFAULT_EMBEDDED_BROKER_URL = "vm://localhost?broker.persistent=false";

    private static final String DEFAULT_NETWORK_BROKER_URL = "tcp://localhost:61616";

    private final ActiveMQProperties properties;

    private final List<ActiveMQConnectionFactoryCustomizer> factoryCustomizers;

    ActiveMQConnectionFactoryFactory(ActiveMQProperties properties,
            List<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) {
        Assert.notNull(properties, "Properties must not be null");
        this.properties = properties;
        this.factoryCustomizers = (factoryCustomizers != null) ? factoryCustomizers : Collections.emptyList();
    }

    public <T extends ActiveMQConnectionFactory> T createConnectionFactory(Class<T> factoryClass) {
        try {
            return doCreateConnectionFactory(factoryClass);
        }
        catch (Exception ex) {
            throw new IllegalStateException("Unable to create " + "ActiveMQConnectionFactory", ex);
        }
    }

    private <T extends ActiveMQConnectionFactory> T doCreateConnectionFactory(Class<T> factoryClass) throws Exception {
        T factory = createConnectionFactoryInstance(factoryClass);
        if (this.properties.getCloseTimeout() != null) {
            factory.setCloseTimeout((intthis.properties.getCloseTimeout().toMillis());
        }
        factory.setNonBlockingRedelivery(this.properties.isNonBlockingRedelivery());
        if (this.properties.getSendTimeout() != null) {
            factory.setSendTimeout((intthis.properties.getSendTimeout().toMillis());
        }
        Packages packages = this.properties.getPackages();
        if (packages.getTrustAll() != null) {
            factory.setTrustAllPackages(packages.getTrustAll());
        }
        if (!packages.getTrusted().isEmpty()) {
            factory.setTrustedPackages(packages.getTrusted());
        }
        customize(factory);
        return factory;
    }

    private <T extends ActiveMQConnectionFactory> T createConnectionFactoryInstance(Class<T> factoryClass)
            throws InstantiationException, IllegalAccessException, InvocationTargetException, NoSuchMethodException {
        String brokerUrl = determineBrokerUrl();
        String user = this.properties.getUser();
        String password = this.properties.getPassword();
        if (StringUtils.hasLength(user) && StringUtils.hasLength(password)) {
            return factoryClass.getConstructor(String.class, String.class, String.class).newInstance(user, password,
                    brokerUrl);
        }
        return factoryClass.getConstructor(String.class).newInstance(brokerUrl);
    }

    private void customize(ActiveMQConnectionFactory connectionFactory) {
        for (ActiveMQConnectionFactoryCustomizer factoryCustomizer : this.factoryCustomizers) {
            factoryCustomizer.customize(connectionFactory);
        }
    }

    String determineBrokerUrl() {
        if (this.properties.getBrokerUrl() != null) {
            return this.properties.getBrokerUrl();
        }
        if (this.properties.isInMemory()) {
            return DEFAULT_EMBEDDED_BROKER_URL;
        }
        return DEFAULT_NETWORK_BROKER_URL;
    }
}

TwinJmsConnectionFactoryConfiguration.java
import java.util.stream.Collectors;

import org.apache.activemq.ActiveMQConnectionFactory;
import org.messaginghub.pooled.jms.JmsPoolConnectionFactory;
import org.springframework.beans.factory.ObjectProvider;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.autoconfigure.jms.JmsPoolConnectionFactoryFactory;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQConnectionFactoryCustomizer;
import org.springframework.boot.autoconfigure.jms.activemq.ActiveMQProperties;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;
import org.springframework.context.annotation.Profile;


@Configuration
@Profile({"local"})
public class TwinJmsConnectionFactoryConfiguration {

    @Bean
    @ConfigurationProperties(prefix = "spring.activemq.primary")
    public ActiveMQProperties primaryActiveMQProperties() {
        return new ActiveMQProperties();
    }
    
    @Bean(destroyMethod = "stop")
    @Primary
    @ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "true")
    public JmsPoolConnectionFactory connectionFactory(ActiveMQProperties primaryActiveMQProperties,
            ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactoryFactory(primaryActiveMQProperties,
                factoryCustomizers.orderedStream().collect(Collectors.toList()))
                .createConnectionFactory(ActiveMQConnectionFactory.class);
        return new JmsPoolConnectionFactoryFactory(primaryActiveMQProperties.getPool())
                .createPooledConnectionFactory(connectionFactory);
    }
    
    ////////////////////////////////////////////////////////////////////////////////
    @Bean
    @ConfigurationProperties(prefix = "spring.activemq.sescond")
    public ActiveMQProperties sescondActiveMQProperties() {
        return new ActiveMQProperties();
    }
    
    @Bean(destroyMethod = "stop")
    @ConditionalOnProperty(prefix = "spring.activemq.pool", name = "enabled", havingValue = "true")
    public JmsPoolConnectionFactory sescondPooledJmsConnectionFactory(ActiveMQProperties sescondActiveMQProperties,
            ObjectProvider<ActiveMQConnectionFactoryCustomizer> factoryCustomizers) {
        ActiveMQConnectionFactory connectionFactory = new ActiveMQConnectionFactoryFactory(sescondActiveMQProperties,
                factoryCustomizers.orderedStream().collect(Collectors.toList()))
                .createConnectionFactory(ActiveMQConnectionFactory.class);
        return new JmsPoolConnectionFactoryFactory(sescondActiveMQProperties.getPool())
                .createPooledConnectionFactory(connectionFactory);
    }
    
}




paulwong 2020-03-19 09:45 发表评论
]]>
Which is better: PooledConnectionFactory or CachingConnectionFactory?http://www.qpkxbc.shop/paulwong/archive/2020/03/19/435277.htmlpaulwongpaulwongThu, 19 Mar 2020 01:37:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/19/435277.htmlhttp://www.qpkxbc.shop/paulwong/comments/435277.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/19/435277.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435277.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435277.htmlFrom here:

The difference between the PooledConnectionFactory and the CachingConnectionFactory is a difference in implementation. Below are some of the characteristics that differ between them:

  • Although both the PooledConnectionFactory and the CachingConnectionFactory state that they each pool connections, sessions and producers, the PooledConnectionFactory does not actually create a cache of multiple producers. It simply uses a singleton pattern to hand out a single cached producer when one is requested. Whereas the CachingConnectionFactory actually creates a cache containing multiple producers and hands out one producer from the cache when one is requested.

  • The PooledConnectionFactory is built on top of the Apache Commons Pool project for pooling JMS sessions. This allows some additional control over the pool because there are features in Commons Pool that are not being used by the PooledConnectionFactory. These additional features include growing the pool size instead of blocking, throwing an exception when the pool is exhausted, etc. You can utilize these features by creating your own Commons Pool GenericObjectPool using your own customized settings and then handing that object to the PooledConnectionFactory via the setPoolFactory method. See the following for additional info: http://commons.apache.org/pool/api-1.4/org/apache/commons/pool/impl/GenericObjectPoolFactory.html

  • The CachingConnectionFactory has the ability to also cache consumers. Just need to take care when using this feature so that you know the consumers are cached according to the rules noted in the blog post.

  • But most importantly, the CachingConnectionFactory will work with any JMS compliant MOM. It only requires a JMS connection factory. This is important if you are using more than one MOM vendor which is very common in enterprise organizations (this is mainly due to legacy and existing projects). The important point is that the CachingConnectionFactory works very well with many different MOM implementations, not only ActiveMQ.

From here:

  • If you have clustered ActiveMQs, and use failover transport it has been reported that CachingConnectionFactory is not a right choice.

  • The problem I’m having is that if one box goes down, we should start sending messages on the other, but it seems to still be using the old connection (every send times out). If I restart the program, it’ll connect again and everything works. Source: Autoreconnect problem with ActiveMQ and CachingConnectionFactory

  • The problem is that cached connections to the failed ActiveMQ was still in use and that created the problem for the user. Now, the choice for this scenario is PooledConnectionFactory.

  • If you’re using ActiveMQ today, and chances are that you may switch to some other broker (JBoss MQ, WebSphere MQ) in future, do not use PooledConnectionFactory, as it tightly couples your code to ActiveMQ.



paulwong 2020-03-19 09:37 发表评论
]]>
dockerȝ安装http://www.qpkxbc.shop/yangjunwei/archive/2020/03/17/435272.html杨军?/dc:creator>杨军?/author>Tue, 17 Mar 2020 05:50:00 GMThttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/17/435272.htmlhttp://www.qpkxbc.shop/yangjunwei/comments/435272.htmlhttp://www.qpkxbc.shop/yangjunwei/archive/2020/03/17/435272.html#Feedback0http://www.qpkxbc.shop/yangjunwei/comments/commentRss/435272.htmlhttp://www.qpkxbc.shop/yangjunwei/services/trackbacks/435272.html扚w安装依赖包:rpm -Uvh *.rpm --nodeps --force

安装 container-selinux-2.9-4.el7.noarch.rpm : rpm -Uvh container-selinux-2.9-4.el7.noarch.rpm

pasting

安装 dockerQ?code style="box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; padding: 2px 4px; border: none; vertical-align: middle; white-space: pre-wrap; color: #c7254e; background-color: #f2f2f2;">rpm -Uvh docker-ce-18.03.1.ce-1.el7.centos.x86_64.rpm

pasting
  • 启动dockerQ?code style="box-sizing: border-box; font-size: 12px; font-family: Consolas, Monaco, "Andale Mono", "Ubuntu Mono", monospace; padding: 2px 4px; border: none; vertical-align: middle; white-space: pre-wrap; color: #c7254e; background-color: #f2f2f2;">systemctl start docker
  • 查看docker启动容器列表: docker ps



]]>
Spring Boot Data Mongodb Starter自动配置那些?/title><link>http://www.qpkxbc.shop/paulwong/archive/2020/03/17/435271.html</link><dc:creator>paulwong</dc:creator><author>paulwong</author><pubDate>Tue, 17 Mar 2020 01:39:00 GMT</pubDate><guid>http://www.qpkxbc.shop/paulwong/archive/2020/03/17/435271.html</guid><wfw:comment>http://www.qpkxbc.shop/paulwong/comments/435271.html</wfw:comment><comments>http://www.qpkxbc.shop/paulwong/archive/2020/03/17/435271.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/paulwong/comments/commentRss/435271.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/paulwong/services/trackbacks/435271.html</trackback:ping><description><![CDATA[<div style="font-size: medium;"><div><p>正好做MongodbM复制试使用Spring Boot Data Mongodb Starter插g链接讉KMongodb数据库集?/p><p>遇到的坑Q?/p><ul><li>spring.data.mongodb.host和spring.data.mongodb.port形式不适合集群配置Q会报host无法识别异常</li><li>spring.data.mongodb.uri中经常抛出authentication failed异常</li></ul><p><br /></p><p>解决办法Q?/p><ol><li> 对于W一个坑Q请使用spring.data.mongodb.uri?span style="background-color: yellow;">如果使用了uriQ则其余的host/username/password/db/auth-dbq些全部无效?/span></li><li> 对于W二个坑Q请在spring.data.mongodb.uri中指定replicaSet和authsourceQ另外记得把所有集节Ҏ务器地址都列全?br /><span style="background-color: yellow;">如果auth-db和db是同一个,则无需加authsourceQ如果不同,则加authsource=admin</span></li></ol><p><br /></p><p>我没有把authsource指定Q所以一直报authentication failed异常。然后只好一点点d掘问题点Q最后查到在com.mongodb.ConnectionStringcM的createCredentials?br /><br /></p><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #0000FF; ">private</span> MongoCredential createCredentials(<span style="color: #0000FF; ">final</span> Map<String, List<String>> optionsMap, <span style="color: #0000FF; ">final</span> String userName,<br />                                              <span style="color: #0000FF; ">final</span> <span style="color: #0000FF; ">char</span>[] password) {<br />        AuthenticationMechanism mechanism = <span style="color: #0000FF; ">null</span>;<br />        String authSource = (database == <span style="color: #0000FF; ">null</span>) ? "admin" : database;<br />        String gssapiServiceName = <span style="color: #0000FF; ">null</span>;<br />        String authMechanismProperties = <span style="color: #0000FF; ">null</span>;<br /><br />        <span style="color: #0000FF; ">for</span> (<span style="color: #0000FF; ">final</span> String key : AUTH_KEYS) {<br />            String value = getLastValue(optionsMap, key);<br /><br />            <span style="color: #0000FF; ">if</span> (value == <span style="color: #0000FF; ">null</span>) {<br />                <span style="color: #0000FF; ">continue</span>;<br />            }<br /><br />            <span style="color: #0000FF; ">if</span> (key.equals("authmechanism")) {<br />                mechanism = AuthenticationMechanism.fromMechanismName(value);<br />            } <span style="color: #0000FF; ">else</span> <span style="color: #0000FF; ">if</span> (key.equals("authsource")) {<br />                authSource = value;<br />            } <span style="color: #0000FF; ">else</span> <span style="color: #0000FF; ">if</span> (key.equals("gssapiservicename")) {<br />                gssapiServiceName = value;<br />            } <span style="color: #0000FF; ">else</span> <span style="color: #0000FF; ">if</span> (key.equals("authmechanismproperties")) {<br />                authMechanismProperties = value;<br />            }<br />        }<br /><br /><br />        MongoCredential credential = <span style="color: #0000FF; ">null</span>;<br />        <span style="color: #0000FF; ">if</span> (mechanism != <span style="color: #0000FF; ">null</span>) {<br />            <span style="color: #0000FF; ">switch</span> (mechanism) {<br />                <span style="color: #0000FF; ">case</span> GSSAPI:<br />                    credential = MongoCredential.createGSSAPICredential(userName);<br />                    <span style="color: #0000FF; ">if</span> (gssapiServiceName != <span style="color: #0000FF; ">null</span>) {<br />                        credential = credential.withMechanismProperty("SERVICE_NAME", gssapiServiceName);<br />                    }<br />                    <span style="color: #0000FF; ">break</span>;<br />                <span style="color: #0000FF; ">case</span> PLAIN:<br />                    credential = MongoCredential.createPlainCredential(userName, authSource, password);<br />                    <span style="color: #0000FF; ">break</span>;<br />                <span style="color: #0000FF; ">case</span> MONGODB_CR:<br />                    credential = MongoCredential.createMongoCRCredential(userName, authSource, password);<br />                    <span style="color: #0000FF; ">break</span>;<br />                <span style="color: #0000FF; ">case</span> MONGODB_X509:<br />                    credential = MongoCredential.createMongoX509Credential(userName);<br />                    <span style="color: #0000FF; ">break</span>;<br />                <span style="color: #0000FF; ">case</span> SCRAM_SHA_1:<br />                    credential = MongoCredential.createScramSha1Credential(userName, authSource, password);<br />                    <span style="color: #0000FF; ">break</span>;<br />                <span style="color: #0000FF; ">default</span>:<br />                    <span style="color: #0000FF; ">throw</span> <span style="color: #0000FF; ">new</span> UnsupportedOperationException(format("The connection string contains an invalid authentication mechanism'. "<br />                                                                           + "'%s' is not a supported authentication mechanism",<br />                            mechanism));<br />            }<br />        } <span style="color: #0000FF; ">else</span> <span style="color: #0000FF; ">if</span> (userName != <span style="color: #0000FF; ">null</span>) {<br />            credential = MongoCredential.createCredential(userName, authSource, password);<br />        }<br /><br />        <span style="color: #0000FF; ">if</span> (credential != <span style="color: #0000FF; ">null</span> && authMechanismProperties != <span style="color: #0000FF; ">null</span>) {<br />            <span style="color: #0000FF; ">for</span> (String part : authMechanismProperties.split(",")) {<br />                String[] mechanismPropertyKeyValue = part.split(":");<br />                <span style="color: #0000FF; ">if</span> (mechanismPropertyKeyValue.length != 2) {<br />                    <span style="color: #0000FF; ">throw</span> <span style="color: #0000FF; ">new</span> IllegalArgumentException(format("The connection string contains invalid authentication properties. "<br />                            + "'%s' is not a key value pair", part));<br />                }<br />                String key = mechanismPropertyKeyValue[0].trim().toLowerCase();<br />                String value = mechanismPropertyKeyValue[1].trim();<br />                <span style="color: #0000FF; ">if</span> (key.equals("canonicalize_host_name")) {<br />                    credential = credential.withMechanismProperty(key, Boolean.valueOf(value));<br />                } <span style="color: #0000FF; ">else</span> {<br />                    credential = credential.withMechanismProperty(key, value);<br />                }<br />            }<br />        }<br />        <span style="color: #0000FF; ">return</span> credential;<br />    }</div><p><br /></p><p>authSource默认会指向我们目标数据的数据库。然而在w䆾验证机制中我们通常需要指向admin。(非常x_口Q代码作者在q里脑袋被men挤了么)。所以需要强制指定authSource中指定。具体指定方式如下:</p><p> </p><p> </p><p> </p><p> </p><pre bash"=""><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->mongodb://{用户名}:{密码}@{host1}:27017,{host2}:27017,{host3}:27017/{目标数据库}?replicaSet={复制集名U}&write=1&readPreference=primary&authsource={授权数据库}</div></pre></div></div><img src ="http://www.qpkxbc.shop/paulwong/aggbug/435271.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/paulwong/" target="_blank">paulwong</a> 2020-03-17 09:39 <a href="http://www.qpkxbc.shop/paulwong/archive/2020/03/17/435271.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SPRING BATCH中STEP如果没加TRANSACTION MANAGERhttp://www.qpkxbc.shop/paulwong/archive/2020/03/16/435267.htmlpaulwongpaulwongMon, 16 Mar 2020 01:43:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/16/435267.htmlhttp://www.qpkxbc.shop/paulwong/comments/435267.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/16/435267.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435267.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435267.html
+------------+--------------+-------------+-----------------+------------------+--------------------+----------------+-----------+-------------------------
 | READ_COUNT | FILTER_COUNT | WRITE_COUNT | READ_SKIP_COUNT | WRITE_SKIP_COUNT | PROCESS_SKIP_COUNT | ROLLBACK_COUNT | EXIT_CODE | EXIT_MESSAGE
-+------------+--------------+-------------+-----------------+------------------+--------------------+----------------+-----------+-------------------------
 |          1 |            0 |           1 |               0 |                0 |                  0 |              0 | COMPLETED |
 |      30006 |            0 |       29947 |               0 |               59 |                  0 |             61 | COMPLETED | Waited for 101 results.

如上面的L?0006Q但COMMIT的L?9947Q有59个被跌了?br />
因此需在STEP上加TRANSACTION MANAGER.

https://stackoverflow.com/questions/42803941/spring-batch-incorrect-write-skip-count-issue



paulwong 2020-03-16 09:43 发表评论
]]>
IPFS参考网?/title><link>http://www.qpkxbc.shop/waterjava/archive/2020/03/14/435258.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sat, 14 Mar 2020 03:01:00 GMT</pubDate><guid>http://www.qpkxbc.shop/waterjava/archive/2020/03/14/435258.html</guid><wfw:comment>http://www.qpkxbc.shop/waterjava/comments/435258.html</wfw:comment><comments>http://www.qpkxbc.shop/waterjava/archive/2020/03/14/435258.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/waterjava/comments/commentRss/435258.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/waterjava/services/trackbacks/435258.html</trackback:ping><description><![CDATA[<a >https://ipfs.github.io/public-gateway-checker/</a><img src ="http://www.qpkxbc.shop/waterjava/aggbug/435258.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/waterjava/" target="_blank">狼爱上狸</a> 2020-03-14 11:01 <a href="http://www.qpkxbc.shop/waterjava/archive/2020/03/14/435258.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>IM要做手机扫码dQ先看看微信的扫码登录功能技术原?/title><link>http://www.qpkxbc.shop/jb2011/archive/2020/03/13/435256.html</link><dc:creator>Jack Jiang</dc:creator><author>Jack Jiang</author><pubDate>Fri, 13 Mar 2020 09:15:00 GMT</pubDate><guid>http://www.qpkxbc.shop/jb2011/archive/2020/03/13/435256.html</guid><wfw:comment>http://www.qpkxbc.shop/jb2011/comments/435256.html</wfw:comment><comments>http://www.qpkxbc.shop/jb2011/archive/2020/03/13/435256.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/jb2011/comments/commentRss/435256.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/jb2011/services/trackbacks/435256.html</trackback:ping><description><![CDATA[<p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">本文原文׃者Amazing10原创发布于公众号业余码农Q收录时有改动,感谢原作者的技术分享?/p><h1>1、引a</h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">某天中午Q吃完午饭,摊在自己的h椅上Q想吃饱喝的午后旉静静享受独自的静谧?/p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div> </div><div data-width="448" data-height="216"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313170904107-1045921616.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div><div data-width="448" data-height="216"> </div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">q点什么好呢?于是单手操作鼠标打开了一个陌生而隐U的|站。正开着某个视频起劲。。?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>H然览器弹Z一个提C:</strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">请用微信扫码登录̎Pl箋观看</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">q?..</p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div> </div><div data-width="308" data-height="307"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313170919120-1431681588.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div><div data-width="308" data-height="307"> </div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">但是׃强烈的好奇驱使,q于无奈Q只好选择d再l观看。于是熟l的掏出手机Q打开微信扫一扫对准上面的二维码,只听?“?#8221; 的一壎ͼ|页上的二维码放佛活q来了,直接hZ本尊的微信头像,同时手机上也弹出d的提醒?/p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div> </div><div><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313170930949-772178543.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div><div data-width="308" data-height="231"> </div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">心中略微惊叹Q但没来得及多想。忙点击手机界面中登录按钮。此时网刷斎ͼ恢复了正常,表示可以l箋观看?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">上网冲浪的时间Lq得很快Q很快就有些疲倦。于是闭上眼睛,脑v中却现Z刚刚微信扫描二维码,然后d|页的场景,心中再次惊叹Qƈ开始思考v其中的原理来。。?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">a归正传,本文以LzL的语a形式Qؓ你分析和讲解微信手机扫码d的技术原理,希望在你的IM中开发此功能时有所启发?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>推荐阅读Q?/strong>另一同cL章?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM的扫码登录功能如何实玎ͼ一文搞懂主的扫码d技术原?/a>》也值得一诅R?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>学习交流Q?/strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">- x通讯/推送技术开发交?:<a target="_blank" style="color: #1d58d1; text-decoration-line: none;">215477170</a>[推荐]</p><p style="margin-top: 10px; margin-bottom: 10px;">- Ud端IM开发入门文章:?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">新手入门一就够:从零开发移动端IM</a>?/p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">Q本文同步发布于Q?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">http://www.52im.net/thread-2941-1-1.html</a>Q?/p><h1>2、IM开发干货系列文?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>本文是系列文章中的第23,ȝ录如下:</strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM消息送达保证机制实现(一)Q保证在U实时消息的可靠投?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM消息送达保证机制实现(?Q保证离U消息的可靠投?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">如何保证IM实时消息?#8220;时序?#8221;?#8220;一致?#8221;Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM单聊和群聊中的在U状态同步应该用“?#8221;q是“?#8221;Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM聊消息如此复杂Q如何保证不丢不重?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">一UAndroid端IM心蟩法的设计与实现探讨Q含样例代码Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Ud端IMd时拉取数据如何作到省量Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">通俗易懂Q基于集的Ud端IM接入层负载均衡方案分?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">谈Ud端IM的多点登录和消息漫游原理</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(一)Q正理解前|HTTP SSO单点d接口的原?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q如何设计大量图片文件的服务端存储架构?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q快速理解服务端数据库读写分d理及实践</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q正理解HTTP短连接中的Cookie、Session和Token</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM聊消息的已d执功能该怎么实现Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM聊消息I竟是存1?x散读)q是存多?x散写)Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q通俗易懂Q正理解ƈ用好MQ消息队列</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">一个低成本保IM消息时序的方法探?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q数据库用NoSQLq是SQLQ读q篇够了!</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM?#8220;附近的h”功能实现原理是什么?如何高效率地实现它?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q主移动端账号d方式的原理及设计思\</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM开发基知识补课(?Q史上最通俗Q彻底搞懂字Wؕ码问题的本质</a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM的扫码登功能如何实现Q一文搞懂主应用的扫码d技术原?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">IM要做手机扫码登陆Q先看看微信的扫码登录功能技术原?/a>》(本文Q?/p></blockquote><h1>3、原理解?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">微信扫码d现在在日常生zM已经是常见不能再常见的场景之一了,但是要知道微信首ơ公开q项功能Ӟ却是惊艳众h。移动端与PC端以q样一Uy妙的方式链接在了一P的确是让人惊叏V?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>以下是一个典型的微信扫码d全过E:</strong> </p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="940" data-height="342"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171005502-326284773.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>本来惛_Web版微信上截图Q但扫码登陆后出C下面的提C(貌似很多人都到q)Q?nbsp;</strong></p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="729" data-height="478"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171011658-217538922.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">好吧Q这很微信,反正是不想让你好好用,用户爱咋咋滴。。?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>如上图所C,操作q程如下Q?/strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">1Q第一步:电脑上打开PC端(出现2l码Q;</p><p style="margin-top: 10px; margin-bottom: 10px;">2Q第二步Q拿出手机,扫码2l码Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">3Q第三步QPC端显C扫码成功;</p><p style="margin-top: 10px; margin-bottom: 10px;">4Q第四步Q手机端“认”dQ?/p><p style="margin-top: 10px; margin-bottom: 10px;">5Q第五步Q成功登陆PC端?/p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">上述实际操作q程Q用户体验相当顺滑,也难怪刚出来那会Q能惊艳到很多h?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">那么Q对于上q操作过E的技术实现原理是什么样的呢Q?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">惌v来之前听q的前后端的概念Q知道̎L数据信息一般都是放在服务器上,前端负责向后?“讨要数据” q显C,后端则是对前端的 “讨要” 做出反应?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>q样一来,猜测微信d的过E可能就是:</strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">1Q网前端向微信后台h账号数据Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">2Q微信后台接受网前端的hQ然后将他的账号数据q回Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">3Q网前端接收到了数据后Q在览器里q行昄?/p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>于是Q手脚麻利的M个示意图Q?/strong></p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="638" data-height="172"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171027419-1729320298.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">当我正准备沾沾自喜的时候,H然看到桌面上的手机。咦Q如果就只是q么个过E,那手机的作用是啥。于是才开始意识到Q问题没q么单?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">好吧Q我们城要再深入一ҎU微信扫码登录的q程?/p><h1>4、过E分?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">Z更深入的分析整个q程Q我们可以去看看微信|页版,地址是:<a target="_blank" style="color: #1d58d1; text-decoration-line: none;">https://wx.qq.com/</a>?/p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div> </div><div data-width="547" data-height="470"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171037042-49199125.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">W者看着|页中硕大的二维码陷入了沉?#8212;—q个二维码跟手机账号有没有什么对应关pdQ如果没有,那它又是怎么生成的呢Q?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">思考间Q于是打开了浏览器的开发者工兗?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>在网l监控一览找Cq幅二维码,与之对应的链接是Q?/strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">https://login.weixin.qq.com/qrcode/gaO8cOQweA==</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>如下图所C:</strong></p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="800" data-height="687"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171054557-145201188.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>然后习惯性地Q尝试多ơ刷新页面,发现二维码不断发生变化,链接也不断更改:</strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">https://login.weixin.qq.com/qrcode/AencxgKNFQ==</p><p style="margin-top: 10px; margin-bottom: 10px;">https://login.weixin.qq.com/qrcode/YcD7f_DxvA==</p><p style="margin-top: 10px; margin-bottom: 10px;">https://login.weixin.qq.com/qrcode/QblN8lCn2g==</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">g发现了些东西Q二l码不断变化Q其对应的链接尾的代码也相应变化Qƈ且是随机性的变化?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">q也是_每一ơ页面刷新都会随Z唯一地生成一个二l码。这或许可以与手机登录的q程联系h?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">g开始明白了Q于是再ơ拿h机,熟练的用微信扫描了此时的二l码?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">“?#8221; 的一壎ͼ|页上的二维码顿时变成了我帅气的微信头像。这个时候,我才H然意识刎ͼ是扫码之后网|与他的微信̎号徏立v了联pR?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>如下图所C:</strong> </p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="496" data-height="384"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171108338-2003747687.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>也就是说Q?/strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">1Q没有扫码之前,面上的二维码只是随机生成的且与用户无关的码Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">2Q而当用户扫码之后Q二l码便与用户帐号l定在了一赗?/p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">原来手机扫码的用处是q样Q?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">此时注意刎ͼ手机微信上弹Z『微信登录确认』的提醒。这个时候}慎地点击了下方的d按钮?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>如下图所C:</strong> </p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="256" data-height="454"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171120313-1427134289.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">随着qx的动M闪而过Q网上已经昄Z我的微信账号信息Q显C微信̎号已l登录。再一ơ体验这个过E,心中开始思烦手机微信在登录过E中所起到的具体作用?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>首先需要明白几个过E:</strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">1Q进入网늙陆界面,随机生成一个二l码Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">2Q通过手机扫描二维码,微信̎号与二维码绑定;</p><p style="margin-top: 10px; margin-bottom: 10px;">3Q在手机微信点击d按钮Q授权网늙录微信̎P</p><p style="margin-top: 10px; margin-bottom: 10px;">4Q网获得的账号信息Q将数据昄?/p></blockquote><h1>5、原理解?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">回顾上述q程Q结合最开始的原理猜测Q开始思烦整个环节Q是哪里理解的不寏V。?/p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">1Q网늚二维码到底从何而来Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">2Q是谁向微信后台h了̎h据?</p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>实际上:</strong>不同的网站可能都需要通过微信后台q行数据的获取,那么每一个网站必然也存在它的后台来给微信后台发送请求?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>q样一来,整个q程p解释得通了Q?/strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">1Q网站页面刷斎ͼ|页后台向微信后台请求授权登录;</p><p style="margin-top: 10px; margin-bottom: 10px;">2Q微信后台返回登录所需二维码;</p><p style="margin-top: 10px; margin-bottom: 10px;">3Q用户通过手机扫描二维码,q在手机上授权登录后Q微信后台告知网后台已授权Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">4Q网后台向微信后台h微信账号数据Q?/p><p style="margin-top: 10px; margin-bottom: 10px;">5Q微信后台返回̎h据;</p><p style="margin-top: 10px; margin-bottom: 10px;">6Q网后台接收数据ƈ通过览器显C;</p></blockquote><h1>6、技术剖?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">正如上节所qͼx楚了整个q程后,我们应该Ҏ个过E的技术实现进行进一步的探究?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>在微信开发官Ҏ档中Q我扑ֈ了第三方|站应用微信d开发指南:</strong></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><a target="_blank" style="color: #1d58d1; text-decoration-line: none;">https://developers.weixin.qq.com/doc/oplatform/Website_App/WeChat_Login/Wechat_Login.html</a></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>我将整个q程梳理了一遍,d了这个图Q?/strong> </p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div data-width="756" data-height="470"><img src="https://img2020.cnblogs.com/blog/848699/202003/848699-20200313171141876-207571443.jpg" alt="" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">如上图所C,整个技术实现如下?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><span style="color: #3366ff;"><strong><em>Q?Q二l码的获得:</em></strong></span></p><ul style="margin-left: 30px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="list-style-type: disc;">1Q用h开|站后,|站后台Ҏ微信OAuth2.0协议向微信开发^台请求授权登录,q传递事先在微信开发^C审核通过的AppID和AppSecrect{参敎ͼ</li><li style="list-style-type: disc;">2Q微信开发^台对AppID{参数进行验证,q向|站后台q回二维码;</li><li style="list-style-type: disc;">3Q网站后台将二维码传送至|站前端q行昄?/li></ul><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong><span style="color: #3366ff;"><em>Q?Q微信客L授权dQ?/em></span></strong></p><ul style="margin-left: 30px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="list-style-type: disc;">1Q用户用微信客L扫描二维码ƈ授权dQ?/li><li style="list-style-type: disc;">2Q微信客L二l码特定的uid与微信̎L定,传送至微信开发^収ͼ</li><li style="list-style-type: disc;">3Q微信开发^台验证绑定数据,调用|站后台的回调接口,发送授权时票据codeQ?/li></ul><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong><span style="color: #3366ff;"><em>Q?Q网站后台请求数据:</em></span></strong></p><ul style="margin-left: 30px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="list-style-type: disc;">1Q网站后台接收到codeQ表明微信开发^台同意数据请求;</li><li style="list-style-type: disc;">2Q网站后台根据code参数Q再加上AppID和AppSecreth微信开发^台换取access_tokenQ?/li><li style="list-style-type: disc;">3Q微信开发^台验证参敎ͼq返回access_tokenQ?/li><li style="list-style-type: disc;">4Q网站后台收到access_token后即可进行参数分析获得用戯̎h据?/li></ul><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>在上q过E中Q有几个参数值得解释一下(来源官方文档Q:</strong></p><ul style="margin-left: 30px; padding-left: 0px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><li style="list-style-type: disc;">1QAppIDQ应用唯一标识Q在微信开攑^台提交应用审栔R过后获得;</li><li style="list-style-type: disc;">2QAppSecretQ应用密钥,在微信开攑^台提交应用审栔R过后获得;</li><li style="list-style-type: disc;">3QcodeQ授权时票据,W三斚w过codeq行获取access_token的时候需要用刎ͼcode的超时时间ؓ10分钟Q一个code只能成功换取一ơaccess_token卛_效。code的时性和一ơ性保障了微信授权d的安全性?/li></ul><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>整个q程从网站后台向微信开发^台请求授权登录开始,最l目的是Z获得access_tokenQ?/strong></p><blockquote style="background-color: #eeeeee; border-width: 0px 0px 0px 18px; border-top-style: initial; border-right-style: initial; border-bottom-style: initial; border-top-color: initial; border-right-color: initial; border-bottom-color: initial; border-left-color: #cccccc; padding: 4px; margin: 0px; width: 886.391px; color: #000000; font-family: Verdana, Arial, Helvetica, sans-serif;"><p style="margin-top: 10px; margin-bottom: 10px;">access_tokenQ用h权第三方应用发v接口调用的凭?/p></blockquote><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">在获得了access_token后就可以解析用户的一些基本信息,包括头像、用户名、性别、城市等。这样一来,整个微信扫描d的过E就完成了?/p><h1>7、写在最?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">研究到这Q终于大体上对微信扫码登录的整个q程有了清晰的认知。看hg也不难,开发者只需要在|页后端做好对微信公众^台的接口调用卛_实现扫码d?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">怺伸懒腎ͼ忽然又想到在整个q程中还需要考虑时的问题。比如二l码时未扫描、二l码扫描后超时授权、获得access_token后超时等{问题?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">我发C个简单的功能实现hq是需要考虑许多l节Q真的是U怸得来l觉呀。于是我下定军_Q下ơ得上|冲了Q花Ҏ间搭个服务器先把微信扫码dq程实现看看?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">不过Q还得先d微信开攑^台注册开发者帐Pq拥有一个已审核通过的网站应用,q获得相应的AppID和AppSecret才行?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">想了惻Iq是让我先趟一会儿吧。。?/p><div style="font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><div><div> </div><div data-width="571" data-height="324"><img src="https://upload-images.jianshu.io/upload_images/1500839-db86229c6dd92506.jpg" alt="" data-original-src="http://upload-images.jianshu.io/upload_images/1500839-db86229c6dd92506.jpg" data-original-width="571" data-original-height="324" data-original-format="image/jpeg" data-original-filesize="25927" data-image-index="11" style="border: 0px; height: auto; max-width: 100%;" /></div></div></div><h1>附录Q更多IM开发相x?/h1><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>[1] IM开发热门文章:</strong></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">新手入门一就够:从零开发移动端IM</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Ud端IM开发者必?一)Q通俗易懂Q理解移动网l的“?#8221;?#8220;?#8221;</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Ud端IM开发者必??Q史上最全移动弱|络优化Ҏȝ</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">从客L的角度来谈谈Ud端IM的消息可靠性和送达机制</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">CUd端网l短q接的优化手D|ȝQ请求速度、弱|适应、安全保?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">腾讯技术分享:C交|络囄的带宽压~技术演q之?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">白必读Q闲话HTTP短连接中的Session和Token</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Ud端IM开发需要面对的技术问?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">开发IM是自p计协议用字节好q是字符好Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">请问有h知道语音留言聊天的主实现方式吗Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">通俗易懂Q基于集的Ud端IM接入层负载均衡方案分?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">微信对网l媄响的技术试验及分析Q论文全文)</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">x通讯pȝ的原理、技术和应用Q技术论文)</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">开源IM工程“蘑菇街TeamTalk”的现Ӟ一场有始无l的开源秀</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">QQ音乐团队分nQAndroid中的囄压羃技术详解(上篇Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">QQ音乐团队分nQAndroid中的囄压羃技术详解(下篇Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">腾讯原创分n(一)Q如何大q提升移动网l下手机QQ的图片传输速度和成功率</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">腾讯原创分n(?Q如何大q压~移动网l下APP的流量消耗(上篇Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">腾讯原创分n(?Q如何大q压~移动网l下APP的流量消耗(下篇Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">如约而至Q微信自用的Ud端IM|络层跨q_lg库Mars已正式开?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">ZC交|络的Yelp是如何实现v量用户图片的无损压羃的?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">腾讯技术分享:腾讯是如何大q降低带宽和|络量?囄压羃?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">腾讯技术分享:腾讯是如何大q降低带宽和|络量?韌频技术篇)</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">字符~码那点事:快速理解ASCII、Unicode、GBK和UTF-8</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">全面掌握Ud端主图片格式的特点、性能、调优等</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">子弹短信光鲜的背后:|易云信首席架构师分享亿UIMq_的技术实?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">微信技术分享:微信的v量IM聊天消息序列L成实践(法原理)</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">自已开发IM有那么难吗?手把手教你自怸个Andriod版简易IM (有源?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">融云技术分享:解密融云IM产品的聊天消息ID生成{略</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">适合新手Q从零开发一个IM服务端(ZNettyQ有完整源码Q?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">拿v键盘是qԌ跟我一起徒手开发一套分布式IMpȝ</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">>> <a target="_blank" style="color: #1d58d1; text-decoration-line: none;">更多同类文章 ……</a> </p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;"><strong>[2] 有关WEB端即旉讯开发:</strong></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">新手入门_史上最全Web端即旉讯技术原理详?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Web端即旉讯技术盘点:短轮询、Comet、Websocket、SSE</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">SSE技术详解:一U全新的HTML5服务器推送事件技?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Comet技术详解:ZHTTP长连接的Web端实旉信技?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">新手快速入门:WebSocket明教E?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">WebSocket详解Q一Q:初步认识WebSocket技?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">WebSocket详解Q二Q:技术原理、代码演C和应用案例</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">WebSocket详解Q三Q:深入WebSocket通信协议l节</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">WebSocket详解Q四Q:刨根问底HTTP与WebSocket的关p?上篇)</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">WebSocket详解Q五Q:刨根问底HTTP与WebSocket的关p?下篇)</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">WebSocket详解Q六Q:刨根问底WebSocket与Socket的关p?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">socket.io实现消息推送的一点实践及思\</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">LinkedIn的Web端即旉讯实践Q实现单机几十万条长q接</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Web端即旉讯技术的发展与WebSocket、Socket.io的技术实?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Web端即旉讯安全Q跨站点WebSocket劫持漏洞详解(含示例代?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">开源框架Pomelo实践Q搭建Web端高性能分布式IM聊天服务?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">使用WebSocket和SSE技术实现Web端消息推?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">详解Web端通信方式的演q:从Ajax、JSONP ?SSE、Websocket</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">MobileIMSDK-Web的网l层框架Z使用的是Socket.io而不是NettyQ?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">理论联系实际Q从零理解WebSocket的通信原理、协议格式、安全?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">微信程序中如何使用WebSocket实现长连?含完整源?</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">八问WebSocket协议Qؓ你快速解{WebSocket热门疑问</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">快速了解ElectronQ新一代基于Web的跨q_桌面技?/a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">一文读懂前端技术演q:盘点Web前端20q的技术变q史</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">Web端即旉讯基础知识补课Q一文搞懂跨域的所有问题!</a>?/p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">>> <a target="_blank" style="color: #1d58d1; text-decoration-line: none;">更多同类文章 ……</a></p><p style="margin-top: 10px; margin-bottom: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; background-color: #ffffff;">Q本文同步发布于Q?a target="_blank" style="color: #1d58d1; text-decoration-line: none;">http://www.52im.net/thread-2941-1-1.html</a>Q?/p><img src ="http://www.qpkxbc.shop/jb2011/aggbug/435256.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/jb2011/" target="_blank">Jack Jiang</a> 2020-03-13 17:15 <a href="http://www.qpkxbc.shop/jb2011/archive/2020/03/13/435256.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>mySQL Error 1040: Too Many Connectionhttp://www.qpkxbc.shop/paulwong/archive/2020/03/10/435247.htmlpaulwongpaulwongTue, 10 Mar 2020 12:20:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/10/435247.htmlhttp://www.qpkxbc.shop/paulwong/comments/435247.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/10/435247.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435247.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435247.html

To see how many connections are configured for your DB to use:

select @@max_connections;

To change it:

set global max_connections = 200;

To see how many are connected at the current time:

show processlist;
vi /etc/my.cnf

[mysqld]
max_connections = 500


paulwong 2020-03-10 20:20 发表评论
]]>
VMware 安装ghost win7 ghohttp://www.qpkxbc.shop/waterjava/archive/2020/03/10/435245.html狼爱上狸狼爱上狸Tue, 10 Mar 2020 07:29:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/10/435245.htmlhttp://www.qpkxbc.shop/waterjava/comments/435245.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/10/435245.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435245.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435245.html 众所周知Qvmware安装iso格式的系l都是一步步按流E一气呵成。win7和xp很多时候不得不安装ghostpȝQ理由:打补丁太耗费旉了!截止2018.08月,若安装原版win7 sp1Q补丁安装约需5时以上Q如今网速不是问题主要媄响时间的是安装补丁的旉。然而ؓ了省时经常win7不得不安装ghost win7 且格式ؓ*.gho。比如:专注于win7…… 折腾了大半天作文以记之方便后人,ȝ来说3步:
W一步:需?#8221;U净的PE.iso“?#8221;ghost win7镜像“
PEQ推?微pehttp://www.wepe.com.cn/或者IT天空的优启通https://www.itsk.com/topic-software.html
如图下蝲好后Q免安装的,双击打开Q点d下角最后一个图标,生成iso。(可保留不必要每次都生成)
 
W二步:Vmware》新拟机》典型》稍后安装操作系l》windows》按实际情况选择下一步系l类型》虚拟系l名U》安装位|》分配的大小》拆成多个(不然不好拯复制l别处)》完?nbsp;               @q一步和qx一L高手Lq?/div>
演示W二步的新徏
W三?选择从已l准备好的pe启动》进入pe分配I间》关闭》映到本地盘》将gho格式镜像复制q去》改变启动项》进入pe》还原》重启》ok?nbsp;                    @q一步操作演C如下,参考后再操作?/div>
分配I间
 
映射I间方便把本地ghost镜像复制q去Q原因:权限问题虚拟Z物理机隔ȝQ?/div>
标题
断开本地映射》改变启动项Q键盘方向键左或x作移动到BootQ键??键,Ud让CD-ROM序到最上面位置QF10保存。)》进入pe》打开q个软g》选择delete》一键还原》还原完成挂赗DVD/cdҎ物理。教E全部结束!Q!
如有l节疑问请仔l看视频教程Q亲自试q才写的教程?/div>
yanchenyuvip@qq.com
 
 
bios操作图文程Q?/div>
鼠标点击右键Q依ơ选择”甉|”——”x”Q然后再鼠标右键依次选择“甉|”——“启动时进入BIOS”Q这h们就能进入虚拟机的BIOS面板了,q个操作甚至比在实体入BIOS面板q简单哦?/div>
下面的BIOS面板,使用键盘的上下左右键可以q行上下左右的选择Q用键盘的加号“+”减号“-“键可以调整项目的上下序。我们先使用x向键UdD菜单“Boot”界面Q在q里我们使用下方向键先选中“CD-ROM Drive”Q然后用加号键“+”把它UdW一位,q样我们p把Yq启动序讑֮为第一了?/div>
按F10Q选yes保存退出?/div>
————————————————
版权声明Q本文ؓCSDN博主「闫有尽意无琹{的原创文章Q遵?CC 4.0 BY-SA 版权协议Q{载请附上原文出处链接及本声明?/div>
原文链接Qhttps://blog.csdn.net/yanchenyu365/article/details/82023226


狼爱上狸 2020-03-10 15:29 发表评论
]]>安装配置Shibbolethhttp://www.qpkxbc.shop/waterjava/archive/2020/03/09/435243.html狼爱上狸狼爱上狸Mon, 09 Mar 2020 10:20:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/09/435243.htmlhttp://www.qpkxbc.shop/waterjava/comments/435243.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/09/435243.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435243.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435243.html

0.前言

本文介绍了如何搭建ShibbolethQ实现Shibboleth+Ldap的SSO解决Ҏ

1.什么是Shibboleth

Shibboleth是一个基于标准的Q实现组l内部或跨组l的|页单点d的开源Y件包。它允许站点为处于私有保护方式下的受保护的在U资源做通知的认证决定?/p>

Shibboleth软g工具q泛使用联合的n份标准,主要是OASIS安全声称标记语言QSAMLQ,来提供一个联合单点登录和属性交换框架。一个用L他的l织的证书认证,l织Q或IdPQ传送最的必要的n份信息给SP实现认证军_。Shibboleth也提供扩展的隐私功能Q允怸个用户和他们的主站点来控刉攄每一个应用的属性?/p>

Shibboleth目作ؓ一个Internet2中间件活动启动于2000q_q年晚些时候该目和OASIS SAML工作l的工作相联pRShibboleth1.0 ?003q发布,q快速被全世界的研究和教育机构用。随着2005qSAML2.0的发布,2006qShibboleth2.0也发布,SAML标准升到包含所有的多边Q由Shibboleth首创的元数据驱动Ҏ?/p>

Shibboleth作ؓ开源Y件开发,在Apache 软g许可证下发布。关于个别部件的更多信息可以在品页面看到?/p>

2.安装Shibboleth Identity Provider v3.2.1

  1. 切换成root
sudo su 

2.下蝲Shibboleth Identity Provider v3.2.1

wget http://shibboleth.net/downloads/identity-provider/latest/shibboleth-identity-provider-3.2.1.tar.gz tar -xzvf shibboleth-identity-provider-3.2.1.tar.gz cd shibboleth-identity-provider-3.2.1

3.安装Shibboleth Idenentity Provider:

sh-3.2# ./install.sh  Source (Distribution) Directory (press <enter> to accept default): [/Users/zhaoyu.zhaoyu/Applications/shibboleth-identity-provider-3.3.2]  Installation Directory: [/opt/shibboleth-idp]  Hostname: [localhost.localdomain] testdomain.com SAML EntityID: [https://testdomain.com/idp/shibboleth]  Attribute Scope: [localdomain]  Backchannel PKCS12 Password:  Re-enter password:  Cookie Encryption Key Password:  Re-enter password:  Warning: /opt/shibboleth-idp/bin does not exist. Warning: /opt/shibboleth-idp/dist does not exist. Warning: /opt/shibboleth-idp/doc does not exist. Warning: /opt/shibboleth-idp/system does not exist. Warning: /opt/shibboleth-idp/webapp does not exist. Generating Signing Key, CN = testdomain.com URI = https://testdomain.com/idp/shibboleth ... ...done Creating Encryption Key, CN = testdomain.com URI = https://testdomain.com/idp/shibboleth ... ...done Creating Backchannel keystore, CN = testdomain.com URI = https://testdomain.com/idp/shibboleth ... ...done Creating cookie encryption key files... ...done Rebuilding /opt/shibboleth-idp/war/idp.war ... ...done  BUILD SUCCESSFUL Total time: 1 minute 14 seconds 

(from now "{idp.home}" == /opt/shibboleth-idp/)
4.导入 JST library (status界面会用?:

cd /opt/shibboleth-idp/edit-webapp/WEB-INF/lib wget https://build.shibboleth.net/nexus/service/local/repositories/thirdparty/content/javax/servlet/jstl/1.2/jstl-1.2.jar cd /opt/shibboleth-idp/bin ./build.sh -Didp.target.dir=/opt/shibboleth-idp

3.安装指引

3.1 安装apache tomcat 8

1.切换成root

sudo su -

2.修改tomcat?{CATALINA_HOME}/conf/server.xml
?080端口?443端口的地方分别改?0?43

 <Connector port="80" protocol="HTTP/1.1"                                                                                                    connectionTimeout="20000"                redirectPort="443" />

3.生成证书文g

[chengxu@local]keytool -genkeypair -alias "tomcat" -keyalg "RSA" -keystore "./tomcat.keystore" 输入密钥库口?   再次输入新口?  您的名字与姓氏是什? [Unknown]:  cheng 您的l织单位名称是什? [Unknown]:  testdomain.com 您的l织名称是什? [Unknown]:  testdomain.com 您所在的城市或区域名U是什? [Unknown]:   您所在的??自治区名U是什? [Unknown]:   该单位的双字母国?地区代码是什? [Unknown]:   CN=cheng, OU=testdomain.com, O=testdomain.com, L=Unknown, ST=Unknown, C=Unknown是否正确? [?/span>]:  ?  输入 <tomcat> 的密钥口?  (如果和密钥库口o相同, 按回?:   再次输入新口?  [chengxu@local]

4.修改tomcat?{CATALINA_HOME}/conf/server.xmlQ支持https协议

<Connector port="443" protocol="org.apache.coyote.http11.Http11Protocol"                 maxThreads="150" SSLEnabled="true" scheme="https" secure="true"                 clientAuth="false" sslProtocol="TLS"                  keystoreFile="/Users/chengxu/Shibboleth/tomcat/tomcat.keystore"                    keystorePass="xxx"/> 

5.发布Idp Web Application到Tomcat 8 container

vim %{CATALINA_HOME}/conf/Catalina/localhost/idp.xml
<Context docBase="/opt/shibboleth-idp/war/idp.war"          privileged="true"          antiResourceLocking="false"          swallowOutput="true"/>

4.配置host

vim /etc/host 127.0.0.1 testdomain.com

5.重启tomcat
%{CATALINA_HOME}/bin/catalina.sh stop
%{CATALINA_HOME}/bin/catalina.sh start
6.是否服务启动正?br style="box-sizing: border-box;" />讉Khttps://testdomain/idp/status
或?opt/shibboleth-idp/bin; ./status.sh

3.2 配置shibbolethq接ldap

~辑修改ldap.properties

vim /opt/shibboleth/conf/ldap.properties  idp.authn.LDAP.authenticator = bindSearchAuthenticator idp.authn.LDAP.ldapURL = ldap://ldap.example.it:389 idp.authn.LDAP.useStartTLS = false idp.authn.LDAP.useSSL = false idp.authn.LDAP.baseDN = cn=Users,dc=example,dc=org idp.authn.LDAP.userFilter = (uid={user}) idp.authn.LDAP.bindDN = cn=admin,cn=Users,dc=example,dc=org idp.authn.LDAP.bindDNCredential = ###LDAP ADMIN PASSWORD###

6.修改shibboleth ldap配置

vim /opt/shibboleth/conf/services.xml  ?<value>%{idp.home}/conf/attribute-resolver.xml</value> 改ؓ <value>%{idp.home}/conf/attribute-resolver-full.xml</value>
vim /opt/shibboleth-idp/conf/attribute-resolver-full.xml  注释掉下列代码,如果已经注释掉了׃动了Q有些版本已l注释了Q? <!-- <dc:StartTLSTrustCredential id="LDAPtoIdPCredential" xsi:type="sec:X509ResourceBacked">   <sec:Certificate>%     {idp.attribute.resolver.LDAP.trustCertificates}</sec:Certificate>   </dc:StartTLSTrustCredential> -->

重启tomcat

7.获取idp metadata.xml
https://testdomain.com/idp/shibboleth
注意metadata.xml文g中的validUntil属性,如果q期了则修改为未来的某个旉?/p>

4.结

x我们完成了Shibboleth与LDAP集成的安装过E?/p>

下篇Q?nbsp;实现Shibboleth+Ldap到阿里云的单点登?br />
来自Q?/span>https://yq.aliyun.com/articles/350531?tdsourcetag=s_pcqq_aiomsg&do=login&accounttraceid=87b0f203-5d81-4cb7-a986-49615e3962e2&do=login&do=login



狼爱上狸 2020-03-09 18:20 发表评论
]]>idea jsp代码不提CJava代码 http://www.qpkxbc.shop/fiele/archive/2020/03/08/435237.html半导?/dc:creator>半导?/author>Sun, 08 Mar 2020 12:11:00 GMThttp://www.qpkxbc.shop/fiele/archive/2020/03/08/435237.htmlhttp://www.qpkxbc.shop/fiele/comments/435237.htmlhttp://www.qpkxbc.shop/fiele/archive/2020/03/08/435237.html#Feedback0http://www.qpkxbc.shop/fiele/comments/commentRss/435237.htmlhttp://www.qpkxbc.shop/fiele/services/trackbacks/435237.html
q是׃按提C快捷键alt+enterD。解x法一直未扑ֈ合适的?nbsp;
解决ҎQ?br />

]]>
5 ways to customize Spring MVC JSON/XML outputhttp://www.qpkxbc.shop/paulwong/archive/2020/03/08/435236.htmlpaulwongpaulwongSun, 08 Mar 2020 07:55:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/08/435236.htmlhttp://www.qpkxbc.shop/paulwong/comments/435236.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/08/435236.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435236.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435236.htmlhttps://mostafa-asg.github.io/post/customize-json-xml-spring-mvc-output/



paulwong 2020-03-08 15:55 发表评论
]]>
目理推荐好文http://www.qpkxbc.shop/fiele/archive/2020/03/08/435234.html半导?/dc:creator>半导?/author>Sun, 08 Mar 2020 03:41:00 GMThttp://www.qpkxbc.shop/fiele/archive/2020/03/08/435234.htmlhttp://www.qpkxbc.shop/fiele/comments/435234.htmlhttp://www.qpkxbc.shop/fiele/archive/2020/03/08/435234.html#Feedback0http://www.qpkxbc.shop/fiele/comments/commentRss/435234.htmlhttp://www.qpkxbc.shop/fiele/services/trackbacks/435234.html

]]>
MongDBq接池参数serverSelectionTimeout、connectTimeout、maxWaitTime和socketTimeout介绍http://www.qpkxbc.shop/paulwong/archive/2020/03/07/435231.htmlpaulwongpaulwongSat, 07 Mar 2020 12:58:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/07/435231.htmlhttp://www.qpkxbc.shop/paulwong/comments/435231.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/07/435231.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435231.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435231.htmlMongDB Clienth查询数据Q需要包括五个阶D:
MongoDB Client需要找到可用的MongoDB Server
MongoDB Client需要和MongoDB Server建立QnewQConnection
应用E序处理U程从Connection Pool中获取Connection
数据传输Q获取连接后Q进行Socket通信Q获取数据)
断开Collection
那么QMongoDB Client驱动讄中网l相关等待超时参数serverSelectionTimeout、connectTimeout、maxWaitTime和socketTimeout分别对应上面哪个环节呢?
参数serverSelectionTimeoutQ对应第1个环节,即MongoDB Client需要找到可用的MongoDB Server所需要的{待旉Q?nbsp;                                            MongDB部v的生产一般由多个服务器组成,要么作ؓ一个复刉或者作Z个分片集,参数                                                     serverSelectionTimeout的值即为多长时间内找不到合适服务器时候就军_攑ּ的时间间隔;
参数connectTimeoutQ对应第2个环节,每次创徏ConnectionQ对应的|络{待。单位毫U数, 0表示没有限制Q?/div>
参数maxWaitTimeQ对应第3个环节,应用E序处理U程从连接池中获取CollectionQ对应的|络{待旉。单位毫U数Q?表示                                   不等待,负数表示{待旉不确定;
参数socketTimeoutQ对应第4个环节,获取Connection后,有了Socket通信Q获取数据,卛_MonogoDB Client                                                      和MonogoDB Server的Socket通信q程中的|络{待旉。单位毫U数Q默认配|ؓ0Q也是没有限制Q?nbsp;                                 没有?旉ӞpȝZ问题也不Ҏ发现Q应该根据实际情况,l出合理的超时时间?/div>
 
其他相关参数如下Q?/div>
connectionsPerHostQ对mongo实例来说Q每个host允许链接的最大链接数,q些链接I闲时会攑օ池中,如果链接被耗尽QQ何请求链接的操作会被d{待链接可用,推荐配置10
minPoolsSizeQ当ConnectionI闲?Connection Pool中最Connection保有量;
threadsAllowedToBlockForConnectionMultiplierQ每个Connection的可以阻塞等待的U程队列敎ͼ它以上面connectionsPerHost值相乘的l果是d{待的线E队列最大倹{如果连接线E排满了队列׃抛出“Out of semaphores to get db”错误?/div>
socketKeepAlive:该标志用于控制socket保持zd的功能,通过防火墙保持连接活着
socketKeepAlive=false
autoConnectRetryQ这个控制是否在一个ConnectionӞpȝ会自动重?/div>
#true:假如Connection不能建立?驱动重试相同的server,有最大的重试ơ数,默认?5?q样可以避免一些server因ؓ一些阻塞操作零时down而驱动抛出异?q个对^滑过度到一个新的master,也是很有用的,注意:当集ؓ复制集时,驱动在q段旉?试链接到旧的master?而不会马上链接到新master?/div>
#false 当在q行socketd?不会L异常抛出,驱动已经有自动重建破坏链接和重试L? 推荐配置false
autoConnectRetry=false
#重新打开链接到相同server的最大毫U数,推荐配置?Q如?autoConnectRetry=true,表示旉?5s
#com.jd.mongodbclient2.mongo.JDClientMongo.maxAutoConnectRetryTime=false
#表示当没有手动关闭游标时,是否有一个自动释放游标对象的Ҏ,如果你L很小心的关闭游标,则可以将其设为false 推荐配置true

https://docs.mongodb.com/manual/reference/connection-string/#connections-connection-options
————————————————
版权声明Q本文ؓCSDN博主「pursuer211」的原创文章Q遵?CC 4.0 BY-SA 版权协议Q{载请附上原文出处链接及本声明?/div>
原文链接Qhttps://blog.csdn.net/pursuer211/article/details/82994027


paulwong 2020-03-07 20:58 发表评论
]]>Android Studio 以逍遥模拟器ؓ模拟?/title><link>http://www.qpkxbc.shop/waterjava/archive/2020/03/07/435230.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Sat, 07 Mar 2020 11:08:00 GMT</pubDate><guid>http://www.qpkxbc.shop/waterjava/archive/2020/03/07/435230.html</guid><wfw:comment>http://www.qpkxbc.shop/waterjava/comments/435230.html</wfw:comment><comments>http://www.qpkxbc.shop/waterjava/archive/2020/03/07/435230.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/waterjava/comments/commentRss/435230.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/waterjava/services/trackbacks/435230.html</trackback:ping><description><![CDATA[在C盘根目录下徏立以下批处理文gQ?br /><br /><div>c:</div><div>cd C:\Program Files\Microvirt\MEmu</div><div>adb start-server</div><div>c:</div><div>cd C:\Android\Sdk\platform-tools</div><div>adb  connect 127.0.0.1:21503</div><div>cd\<br /><br />在命令提C符Q管理员Q下q行它就OK了?/div><img src ="http://www.qpkxbc.shop/waterjava/aggbug/435230.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/waterjava/" target="_blank">狼爱上狸</a> 2020-03-07 19:08 <a href="http://www.qpkxbc.shop/waterjava/archive/2020/03/07/435230.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android SDK搬家http://www.qpkxbc.shop/waterjava/archive/2020/03/07/435229.html狼爱上狸狼爱上狸Sat, 07 Mar 2020 10:59:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/07/435229.htmlhttp://www.qpkxbc.shop/waterjava/comments/435229.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/07/435229.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435229.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435229.htmlflutter config --android-sdk 自己的android sdk路径Android SDK默认的安装地址为:
C:\Users\Administrator\AppData\Local\Android\SDK
现需要把它搬?C:\Android\Sdk
操作如下Q?br />1.把C:\Users\Administrator\AppData\Local\Android\SDK剪切复制到C:\Android\SdkQ?br />2.在FLutter sdk 目录下运行如下命令:
flutter config --android-sdk C:\Android\Sdk
3.在环境变量中把ANDROID_HOME改ؓC:\Android\SdkQ?br />重启Q这样就OK了?/div>

狼爱上狸 2020-03-07 18:59 发表评论
]]>使用 Spring Batch 构徏企业U批处理应用-2http://www.qpkxbc.shop/paulwong/archive/2020/03/06/435226.htmlpaulwongpaulwongFri, 06 Mar 2020 05:47:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/06/435226.htmlhttp://www.qpkxbc.shop/paulwong/comments/435226.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/06/435226.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435226.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435226.html阅读全文

paulwong 2020-03-06 13:47 发表评论
]]>
使用 Spring Batch 构徏企业U批处理应用-1http://www.qpkxbc.shop/paulwong/archive/2020/03/06/435225.htmlpaulwongpaulwongFri, 06 Mar 2020 05:45:00 GMThttp://www.qpkxbc.shop/paulwong/archive/2020/03/06/435225.htmlhttp://www.qpkxbc.shop/paulwong/comments/435225.htmlhttp://www.qpkxbc.shop/paulwong/archive/2020/03/06/435225.html#Feedback0http://www.qpkxbc.shop/paulwong/comments/commentRss/435225.htmlhttp://www.qpkxbc.shop/paulwong/services/trackbacks/435225.html阅读全文

paulwong 2020-03-06 13:45 发表评论
]]>
mysql 微信늧 囑փW号 q 解决http://www.qpkxbc.shop/lhbjava/archive/2020/03/05/435217.html林的林的Thu, 05 Mar 2020 05:34:00 GMThttp://www.qpkxbc.shop/lhbjava/archive/2020/03/05/435217.htmlhttp://www.qpkxbc.shop/lhbjava/comments/435217.htmlhttp://www.qpkxbc.shop/lhbjava/archive/2020/03/05/435217.html#Feedback0http://www.qpkxbc.shop/lhbjava/comments/commentRss/435217.htmlhttp://www.qpkxbc.shop/lhbjava/services/trackbacks/435217.htmlhttps://blog.csdn.net/qq_31122833/article/details/83992085

林的 2020-03-05 13:34 发表评论
]]>
Nonogram求解程?/title><link>http://www.qpkxbc.shop/feenn/archive/2020/03/04/435211.html</link><dc:creator>Feenn</dc:creator><author>Feenn</author><pubDate>Wed, 04 Mar 2020 05:56:00 GMT</pubDate><guid>http://www.qpkxbc.shop/feenn/archive/2020/03/04/435211.html</guid><wfw:comment>http://www.qpkxbc.shop/feenn/comments/435211.html</wfw:comment><comments>http://www.qpkxbc.shop/feenn/archive/2020/03/04/435211.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/feenn/comments/commentRss/435211.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/feenn/services/trackbacks/435211.html</trackback:ping><description><![CDATA[法是单的逐行逐列剪枝法,只不q加入了q程的可视化。支持Q意Size的puzzleQ支持三U可视化ҎQ?br /><strong>1.Console字符输出Q?/strong><br /><img src="http://www.qpkxbc.shop/images/blogjava_net/feenn/未命?png" border="0" alt="" /><br /><br /><strong>2.Console输入Q带有ANSI Color字符Q需要Terminal支持QWindows下推荐用cmder{)</strong><br /><img src="http://www.qpkxbc.shop/images/blogjava_net/feenn/test.png" border="0" alt="" /><br /><br /><strong>3. H口输出Q在H口中输出结果,支持保存囄Q支持查看每一步?/strong><br /><img src="http://www.qpkxbc.shop/images/blogjava_net/feenn/test2.png" border="0" alt="" /><br /><br />源代码:<a >https://github.com/feenn/nonogram</a><img src ="http://www.qpkxbc.shop/feenn/aggbug/435211.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/feenn/" target="_blank">Feenn</a> 2020-03-04 13:56 <a href="http://www.qpkxbc.shop/feenn/archive/2020/03/04/435211.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Android-X86|络讄http://www.qpkxbc.shop/waterjava/archive/2020/03/03/435206.html狼爱上狸狼爱上狸Tue, 03 Mar 2020 10:43:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/03/435206.htmlhttp://www.qpkxbc.shop/waterjava/comments/435206.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/03/435206.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435206.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435206.htmlhttps://blog.csdn.net/weixin_30598225/article/details/98351753?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

狼爱上狸 2020-03-03 18:43 发表评论
]]>
VM安装Androidhttp://www.qpkxbc.shop/waterjava/archive/2020/03/03/435205.html狼爱上狸狼爱上狸Tue, 03 Mar 2020 08:20:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/03/435205.htmlhttp://www.qpkxbc.shop/waterjava/comments/435205.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/03/435205.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435205.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435205.html
安装后还是无法联|的Q需要以下步骤才能联|:
讄--》网l和互联|?-》私人DNS -->把自动改为关?br />p上网了?img src ="http://www.qpkxbc.shop/waterjava/aggbug/435205.html" width = "1" height = "1" />

狼爱上狸 2020-03-03 16:20 发表评论
]]>
脑残式网l编E入??Q你真的了解127.0.0.1?.0.0.0的区别?http://www.qpkxbc.shop/jb2011/archive/2020/03/03/435204.htmlJack JiangJack JiangTue, 03 Mar 2020 07:53:00 GMThttp://www.qpkxbc.shop/jb2011/archive/2020/03/03/435204.htmlhttp://www.qpkxbc.shop/jb2011/comments/435204.htmlhttp://www.qpkxbc.shop/jb2011/archive/2020/03/03/435204.html#Feedback0http://www.qpkxbc.shop/jb2011/comments/commentRss/435204.htmlhttp://www.qpkxbc.shop/jb2011/services/trackbacks/435204.html阅读全文

Jack Jiang 2020-03-03 15:53 发表评论
]]>
【linux】CentOS 查看pȝ旉Q修Ҏ?/title><link>http://www.qpkxbc.shop/waterjava/archive/2020/03/02/435201.html</link><dc:creator>狼爱上狸</dc:creator><author>狼爱上狸</author><pubDate>Mon, 02 Mar 2020 13:11:00 GMT</pubDate><guid>http://www.qpkxbc.shop/waterjava/archive/2020/03/02/435201.html</guid><wfw:comment>http://www.qpkxbc.shop/waterjava/comments/435201.html</wfw:comment><comments>http://www.qpkxbc.shop/waterjava/archive/2020/03/02/435201.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.qpkxbc.shop/waterjava/comments/commentRss/435201.html</wfw:commentRss><trackback:ping>http://www.qpkxbc.shop/waterjava/services/trackbacks/435201.html</trackback:ping><description><![CDATA[<h1> <a id="cb_post_title_url" >【linux】CentOS 查看pȝ旉Q修Ҏ?/a> </h1> <p> </p> <p> </p> <p>===============CentOS 7.6================</p> <p>1.查看pȝ旉</p> <div> <pre>date</pre> </div> <p> </p> <p>查看当前pȝ旉以及时区<br />l果是:</p> <div> <pre>Mon Jul 8 09:23:31 UTC 2019</pre> </div> <p> </p> <p> </p> <p>2.更改pȝ旉时区</p> <div> <pre>timedatectl set-timezone Asia/Shanghai</pre> </div> <p> </p> <p>3.再次查看</p> <div> <pre>date</pre> </div> <p>l果是:</p> <div> <pre>Mon Jul 8 17:25:28 CST 2019</pre> </div> <p> </p> <p> </p> <p>4.可以重启后查看,防止重启后失?/p> <div> <pre>reboot</pre> </div> <p> </p> <p> </p> <p>=======================</p><img src ="http://www.qpkxbc.shop/waterjava/aggbug/435201.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.qpkxbc.shop/waterjava/" target="_blank">狼爱上狸</a> 2020-03-02 21:11 <a href="http://www.qpkxbc.shop/waterjava/archive/2020/03/02/435201.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>MacOS讄自动dhttp://www.qpkxbc.shop/waterjava/archive/2020/03/02/435200.html狼爱上狸狼爱上狸Mon, 02 Mar 2020 11:47:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/02/435200.htmlhttp://www.qpkxbc.shop/waterjava/comments/435200.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/02/435200.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435200.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435200.htmlhttps://jingyan.baidu.com/article/59a015e375e45af794886582.html

狼爱上狸 2020-03-02 19:47 发表评论
]]>
VM安装CentOS8http://www.qpkxbc.shop/waterjava/archive/2020/03/02/435197.html狼爱上狸狼爱上狸Mon, 02 Mar 2020 10:34:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/02/435197.htmlhttp://www.qpkxbc.shop/waterjava/comments/435197.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/02/435197.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435197.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435197.html
https://blog.csdn.net/BryantJamesHua/article/details/101480034
https://www.cnblogs.com/fanzhenyong/p/11616192.html

狼爱上狸 2020-03-02 18:34 发表评论
]]>
VM安装macOS10.15 VMware TOOLShttp://www.qpkxbc.shop/waterjava/archive/2020/03/01/435193.html狼爱上狸狼爱上狸Sun, 01 Mar 2020 12:45:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/01/435193.htmlhttp://www.qpkxbc.shop/waterjava/comments/435193.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/01/435193.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435193.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435193.htmlhttps://blog.csdn.net/qq_41855420/article/details/102756313

注意要先把虚拟机的安装光盘退出?img src ="http://www.qpkxbc.shop/waterjava/aggbug/435193.html" width = "1" height = "1" />

狼爱上狸 2020-03-01 20:45 发表评论
]]>
VM安装macOS10.15http://www.qpkxbc.shop/waterjava/archive/2020/03/01/435192.html狼爱上狸狼爱上狸Sun, 01 Mar 2020 12:43:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/03/01/435192.htmlhttp://www.qpkxbc.shop/waterjava/comments/435192.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/03/01/435192.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435192.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435192.html
https://blog.csdn.net/qq_41855420/article/details/102750895?depth_1-utm_source=distribute.pc_relevant.none-task&utm_source=distribute.pc_relevant.none-task

在这个地方,要把服务里的那几个VM启动Q否则DHCP无法安装?br />
⑧、设|黑ҎCatalina 10.15



狼爱上狸 2020-03-01 20:43 发表评论
]]>
Flutter打包Apkhttp://www.qpkxbc.shop/waterjava/archive/2020/02/29/435184.html狼爱上狸狼爱上狸Sat, 29 Feb 2020 03:48:00 GMThttp://www.qpkxbc.shop/waterjava/archive/2020/02/29/435184.htmlhttp://www.qpkxbc.shop/waterjava/comments/435184.htmlhttp://www.qpkxbc.shop/waterjava/archive/2020/02/29/435184.html#Feedback0http://www.qpkxbc.shop/waterjava/comments/commentRss/435184.htmlhttp://www.qpkxbc.shop/waterjava/services/trackbacks/435184.htmlhttps://www.jianshu.com/p/d58dab805ca6

keytool -genkey -v -keystore ./key.jks -keyalg RSA -keysize 2048 -validity 10000 -alias key
apk 输出在:
C:\Users\Administrator\AndroidStudioProjects\flutter_app\build\app\outputs\apk\release
key.properties
storePassword=123456
keyPassword=123456
keyAlias=key
storeFile=
C:/Users/Administrator/AndroidStudioProjects/flutter_app/key.jks

b
uild.gradle

def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"


def keystorePropertiesFile = rootProject.file("key.properties")
def keystoreProperties = new Properties()
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
android {
compileSdkVersion 28

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.example.flutter_app"
minSdkVersion 16
targetSdkVersion 28
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

signingConfigs {
release {
keyAlias keystoreProperties['keyAlias']
keyPassword keystoreProperties['keyPassword']
storeFile file(keystoreProperties['storeFile'])
storePassword keystoreProperties['storePassword']
}
}

buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
//signingConfig signingConfigs.debug
signingConfig signingConfigs.release
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}


狼爱上狸 2020-02-29 11:48 发表评论
]]>
python日志提取http://www.qpkxbc.shop/willpower88/archive/2020/02/29/435180.html一?/dc:creator>一?/author>Fri, 28 Feb 2020 18:10:00 GMThttp://www.qpkxbc.shop/willpower88/archive/2020/02/29/435180.htmlhttp://www.qpkxbc.shop/willpower88/comments/435180.htmlhttp://www.qpkxbc.shop/willpower88/archive/2020/02/29/435180.html#Feedback0http://www.qpkxbc.shop/willpower88/comments/commentRss/435180.htmlhttp://www.qpkxbc.shop/willpower88/services/trackbacks/435180.html# -*- coding: utf-8 -*-
#
!/usr/bin/python

import re
import io
import sys

# obj = re.compile(r'(?P<ip>.*?)- - \[(?P<time>.*?)\] "(?P<request>.*?)" (?P<status>.*?) (?P<bytes>.*?) "(?P<referer>.*?)" "(?P<ua>.*?)"')
#
 example:xxxx"id":2640914,"orderId":144115188137125591xxxx"state":10xxxxx"
# 日志整行都需要匹配,需要用的用具体正则匚wQ如(\d{7})Q不需要的用(.*)匚wQM所有需要或不需要部分都?)括v?br />obj = re.compile(r'(.*"id":)(\d{7})(.*"orderId":)(\d{18})(.*"state":)(\d{2})(.*)')

def load_log(path):
# d文g
    with io.open(path, mode="r", encoding="utf-8") as f:
        for line in f:
            line = line.strip()
            parse(line)

def stdin():
# d道输入
    for line in sys.stdin:
        parse(line)

def parse(line):
# 解析单行nginx日志
    try:
        result = obj.match(line)
        print(result.group(2,4,6))
    except:
        pass

if __name__ == '__main__':
    # load_log("/tmp/227.log")
    stdin()


]]>
1һ152ͼ pk10㷨 ٷͧDzǹٷ ͶƵķʽ 3d쿪ź ֹ׽齫 22ѡ5¿ Ϻ齫 Ʊ 㶫ʮһѡ* Ѫ齫ôĶ