CARVIEW |
Select Language
HTTP/2 200
date: Tue, 22 Jul 2025 20:58:36 GMT
content-type: text/html; charset=utf-8
cache-control: max-age=0, private, must-revalidate
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
link: ; rel=preload; as=fetch; crossorigin=use-credentials
referrer-policy: no-referrer-when-downgrade
server-timing: issue_layout-fragment;desc="issue_layout fragment";dur=196.777081,issue_conversation_content-fragment;desc="issue_conversation_content fragment";dur=608.312368,issue_conversation_sidebar-fragment;desc="issue_conversation_sidebar fragment";dur=47.933414,nginx;desc="NGINX";dur=0.943596,glb;desc="GLB";dur=102.37255
strict-transport-security: max-age=31536000; includeSubdomains; preload
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, Accept,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-voltron-version: fd8fbbc
x-xss-protection: 0
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=f5EHY45hLISYQhfkhn5%2BnNY%2FYKfor7A5myuziPy2LLf9%2B6wYifo41WTo8vMBZa%2FFenrNOsayDCN%2FQPUMYtuWPy7RllgsMDBngKU%2FT6q5Ez2GkapOfujFsR6c%2By6hLvNkZkFbd8CVp186HT41I5M7XZ7wBamRvQohSxsMgWb%2FI11Ui9NlgMzJkL7VaUDHkzzsQlZTK%2BVEkKbo%2BpdNk2M2Yb83OHVab9hbqlhYf00WTfWVlfj3HHTNEm6Xd5ojX31UZNJMo4Ujk3Gr72zTIPhgDg%3D%3D--mkpqOjY654nmsVY3--F6qcm%2Bgy3jR%2BXAaNDlJcPw%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.2072011041.1753217915; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 20:58:35 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Wed, 22 Jul 2026 20:58:35 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: D408:256CA9:12CCCE:187B21:687FFB7B
CP_如何动态支持多个企业号 · Issue #2594 · binarywang/WxJava · GitHub
No one assignedNo projectsNo milestoneNone yetNo branches or pull requests
Skip to content
Navigation Menu
{{ message }}
-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
Closed
Labels
Description
简要描述
在 CP_如何支持多个企业号的wiki
中CP的基本配置信息(secret,token,aesKey)都是配置在配置文件中的,然后启动服务的时候直接生成了多个WxCpService
然后存储在map中
@PostConstruct
public void initServices() {
cpServices = this.properties.getAppConfigs().stream().map(a -> {
val configStorage = new WxCpDefaultConfigImpl();
configStorage.setCorpId(this.properties.getCorpId());
configStorage.setAgentId(a.getAgentId());
configStorage.setCorpSecret(a.getSecret());
configStorage.setToken(a.getToken());
configStorage.setAesKey(a.getAesKey());
val service = new WxCpServiceImpl();
service.setWxCpConfigStorage(configStorage);
routers.put(a.getAgentId(), this.newRouter(service));
return service;
}).collect(Collectors.toMap(service -> service.getWxCpConfigStorage().getAgentId(), a -> a));
}
问题
我的服务中有很多个CP的配置信息(100个)并且都存在数据库中,我感觉在项目启动的时候生成100个WxCpService
非常不妥,并且这个配置信息还会动态递增(每接入一个CP用户,我就要在数据库中新增一条配置信息),请问有较好的方式解决这个问题吗。
就比如说我需要调用某个CP用户的接口,就根据数据库里面的配置信息为它生成一个WxCpService
,主要的步骤就是每次都需要调用setWxCpConfigStorage
把数据库存储的配置注入进去,但是setWxCpConfigStorage
方法中有一个initHttp()
,频繁的调用initHttp()
会有性能影响吗
Metadata
Metadata
Assignees
Labels
Projects
Milestone
Relationships
Development
Issue actions
You can’t perform that action at this time.