paulwong

          #

          SPRING INTEGRATION子FLOW

          split-route-aggregate flow 
          split之后,可以將message分給不同的子flow處理,配置如下:
          @Bean
          public IntegrationFlow parallelSplitRouteAggregateFlow() {
              return IntegrationFlows
                      .from(Http.inboundGateway("/trigger"))
                      .handle((p, h) -> Arrays.asList(1, 2, 3))
                      .split()
                      .channel(MessageChannels.executor(Executors.newCachedThreadPool()))
                      .<Integer, Boolean>route(o -> o % 2 == 0, m -> m
                              .subFlowMapping(true, sf -> sf.gateway(oddFlow()))
                              .subFlowMapping(false, sf -> sf.gateway(evenFlow())))
                      .aggregate()
                      .get();
          }

          @Bean
          public IntegrationFlow oddFlow() {
              return flow -> flow.<Integer>handle((payload, headers) -> "odd");
          }

          @Bean
          public IntegrationFlow evenFlow() {
              return flow -> flow.<Integer>handle((payload, headers) -> "even");
          }


          https://stackoverflow.com/questions/50121384/spring-integration-parallel-split-route-aggregate-flow-fails-due-to-one-way-mess

          posted @ 2020-10-15 11:29 paulwong 閱讀(499) | 評論 (0)編輯 收藏

          在LINUX中格式化JSON的工具-jq

          安裝:
          wget -O jq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64
          chmod +x ./jq
          cp jq /usr/bin

          posted @ 2020-10-12 09:55 paulwong 閱讀(344) | 評論 (0)編輯 收藏

          懷舊框架集合

               摘要: 最近在公司用JUP框架做項目,發現這個框架是別人基于SpringSide封裝的,所以打算學習下,SpringSide,其中遇到了很多坑,做個記錄,網上關于這方面的資料都有些老了,而且SpringSide最新的版本是SpringSide-Utils,老一點的版本為v4.2.2.GA,以下分別對這兩個版本分別介紹下,主要內容來自于網上。一些資料:Github源碼地址:  https://gi...  閱讀全文

          posted @ 2020-10-09 19:14 paulwong 閱讀(310) | 評論 (0)編輯 收藏

          線上JVM工具

          https://github.com/vipshop/vjtools

          posted @ 2020-10-09 19:12 paulwong 閱讀(261) | 評論 (0)編輯 收藏

          基于Spring Cloud的快速開發腳手架&最佳實踐總結

          Spring Cloud 你懂的
          Keycloak 微服務認證授權
          Jenkins 持續集成
          SonarQube 代碼質量控制


          https://gitee.com/itmuch/spring-cloud-yes

          posted @ 2020-10-09 10:48 paulwong 閱讀(554) | 評論 (0)編輯 收藏

          Keycloak初探

          Keycloak是Jboss出品的做認證和授權的WEB程序,根據OPENIDC協議,OPENID是做認證,OAUTH2.0是做授權,OPENIDC則將這兩者整合。

          有提供一套WEB界面維護用戶、應用與角色。

          Ream則可認為是多租戶,每個租戶的應用和用戶數據是隔離的。

          http://10.80.27.69:8180/auth/realms/quickstart/.well-known/openid-configuration 提供當前所有的API節點。
          get_access_token_from_public_client:
          curl --location --request POST 'http://10.80.27.69:8180/auth/realms/quickstart/protocol/openid-connect/token' \
          --header 'Content-Type: application/x-www-form-urlencoded' \
          --data-urlencode 'username=alice' \
          --data-urlencode 'password=123456' \
          --data-urlencode 'client_id=app-springboot-public' \
          --data-urlencode 'grant_type=password' \
          | jq

          ./get_access_token_from_confidential_client.sh
          curl --location --request POST 'http://10.80.27.69:8180/auth/realms/quickstart/protocol/openid-connect/token' \
          --header 'Content-Type: application/x-www-form-urlencoded' \
          --data-urlencode 'client_id=app-springboot-confidential' \
          --data-urlencode 'client_secret=3acf7692-49cb-4c45-9943-6f3dba512dae' \
          --data-urlencode 'grant_type=client_credentials' \
          | jq

          訪問一個ACCESS TYPE為Bare only的應用的一個API:
          access_token=$(curl \
          -d "client_id=app-springboot-public" \
          -d "username=alice" \
          -d "password=123456" \
          -d "grant_type=password" \
          "http://10.80.27.69:8180/auth/realms/quickstart/protocol/openid-connect/token" \
          | jq -r '.access_token')

          #echo $access_token

          curl -H "Authorization: Bearer $access_token" 'http://10.80.27.69:8182/products' | jq

          訪問用戶信息:
          access_token=$(curl \
          -d "client_id=app-springboot-public" \
          -d "username=alice" \
          -d "password=123456" \
          -d "grant_type=password" \
          "http://10.80.27.69:8180/auth/realms/quickstart/protocol/openid-connect/token" | jq -r '.access_token')


          curl -H "Authorization: Bearer $access_token" http://10.80.27.69:8180/auth/realms/quickstart/protocol/openid-connect/userinfo | jq














          posted @ 2020-10-08 13:56 paulwong 閱讀(739) | 評論 (0)編輯 收藏

          配置docker倉庫鏡像,即使用私服

          編輯/etc/docker/daemon.json,加入以下節點:
          {
            "registry-mirrors": [
              "https://hub-mirror.c.163.com",
              "https://mirror.baidubce.com"
            ]
          }


          posted @ 2020-09-30 15:40 paulwong 閱讀(466) | 評論 (0)編輯 收藏

          以非root用戶運行docker

          [root@dev69 ~]$ groupadd docker
          [root@dev69 ~]$ usermod -aG docker $USER
          [root@dev69 ~]$ reboot
          [paul@dev69 ~]$ docker run hello-world

          docker 安裝:
          [root@dev69 ~]$ yum install -y docker
          [root@dev69 ~]$ systemctl enable docker
          [root@dev69 ~]$ systemctl start docker

          posted @ 2020-09-30 15:10 paulwong 閱讀(490) | 評論 (0)編輯 收藏

          MAVEN私服、DOCKER私服、NPM私服,專治各種私服

          Using Nexus 3 as Your Repository – Part 1: Maven Artifacts
          https://blog.sonatype.com/using-nexus-3-as-your-repository-part-1-maven-artifacts

          Using Nexus 3 as Your Repository – Part 2: npm Packages
          https://blog.sonatype.com/using-nexus-3-as-your-repository-part-2-npm-packages

          Using Nexus 3 as Your Repository – Part 3: Docker Images
          https://blog.sonatype.com/using-nexus-3-as-your-repository-part-3-docker-images

          微服務--使用Nexus Repository Manager 3.0搭建私有Docker倉庫
          https://www.hifreud.com/2018/06/05/02-nexus-docker-repository/

          posted @ 2020-09-30 14:24 paulwong 閱讀(380) | 評論 (0)編輯 收藏

          keycloak 資源

          Keycloak為現代應用和服務提供開源的認證和訪問管理,即通常所說的認證和授權。

          Keycloak支持OpenID、OAuth 2.0和SAML 2.0協議;支持用戶注冊、用戶管理、權限管理;支持OTP,支持代理OpenID、SAML 2.0 IDP,支持GitHub、LinkedIn等第三方登錄,支持整合LDAP和Active Directory;支持自定義認證流程、自定義用戶界面,支持國際化。

          有用戶管理界面,可用于API的認證和用戶的認證,用戶認證需人為輸入用戶名與密碼,API則憑BARE TOKEN即可認證。

          Spring Boot/Angular整合Keycloak實現單點登錄
          https://blog.51cto.com/7308310/2446368

          僅十分鐘即可接入Spring Boot/Vue前後端分離應用實現SSO單點登錄
          https://kknews.cc/code/a6am5pj.html

          SpringBoot整合KeyCloak權限管理
          https://qianmoq.com/fuwuduan/springboot/springbootzhenghekeycloakquanxianguanli.html

          使用Spring Gateway和KeyCloak構建一個OIDC認證系統
          https://zhuanlan.zhihu.com/p/138578359

          A Quick Guide to Using Keycloak with Spring Boot
          https://www.baeldung.com/spring-boot-keycloak

          Keycloak與微服務的整合
          https://gitee.com/itmuch/spring-cloud-yes/blob/master/doc/keycloak-learn/Keycloak%E6%90%AD%E5%BB%BA%E6%89%8B%E6%8A%8A%E6%89%8B%E6%93%8D%E4%BD%9C%E6%8C%87%E5%8D%97.md

          RedHat
          https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.4/html/securing_applications_and_services_guide/openid_connect_3

          https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.4/html-single/authorization_services_guide/index

          https://access.redhat.com/documentation/en-us/red_hat_single_sign-on/7.4/

          posted @ 2020-09-25 15:46 paulwong 閱讀(392) | 評論 (0)編輯 收藏

          僅列出標題
          共115頁: First 上一頁 13 14 15 16 17 18 19 20 21 下一頁 Last 
          主站蜘蛛池模板: 临泽县| 雷波县| 金阳县| 灵璧县| 乌拉特中旗| 阳西县| 海门市| 渑池县| 金阳县| 平遥县| 肃宁县| 东港市| 舟山市| 布拖县| 蕉岭县| 偃师市| 漯河市| 安溪县| 二手房| 芦山县| 县级市| 南川市| 诸城市| 武清区| 洛南县| 济阳县| 桃园市| 淄博市| 翼城县| 利津县| 凤山市| 镶黄旗| 织金县| 白河县| 乌拉特前旗| 祁阳县| 太白县| 九龙城区| 福清市| 勃利县| 绥中县|