我有一个 Docker Compose 文件,它启动两个服务:Redis 和 Redis Commander。使用默认的 Redis 端口 6379 可以正常工作。将Redis端口更改为6380Redis Commander后,无法再连接到Redis。
错误:
setUpConnection Redis error Error: connect ECONNREFUSED 172.19.0.2:6380
Run Code Online (Sandbox Code Playgroud)
这是docker-compose.yml文件:
version: '3.7'
services:
redis:
container_name: redis
hostname: redis
image: sameersbn/redis:4.0.9-2
ports:
- "6380:6379"
expose:
- "6380"
volumes:
- type: volume
source: redis-data
target: /data
restart: always
redis-commander:
container_name: redis-commander
hostname: redis-commander
image: rediscommander/redis-commander:latest
restart: always
environment:
- REDIS_HOSTS=local:redis:6380
ports:
- "8082:8081"
volumes:
redis-data: {}
Run Code Online (Sandbox Code Playgroud)
我可以6380使用以下节点代码在端口上连接到 Redis :
import redis from 'redis'
const config …Run Code Online (Sandbox Code Playgroud) 对于我正在实现的测试用例,我需要模拟该process.cwd()函数。在测试用例中我的实现如下:
process.cwd = jest.fn(() => '/base/dir')
Run Code Online (Sandbox Code Playgroud)
当process.cwd()在测试用例中调用时,它会按预期工作。在我正在测试的模块中,它返回原始值。我究竟做错了什么?
我目前正在使用以下语句从wso2 esb中的本地条目加载数据:
<property name="MAPPING" expression="get-property('mapping_id_ep_v1')" />
Run Code Online (Sandbox Code Playgroud)
它加载以下名为mapping_id_ep_v1的本地条目:
<mappings>
<mapping id="ep_1">http://localhost:8280/services/ep_1</mapping>
<mapping id="ep_2">http://localhost:8280/services/ep_2</mapping>
<mapping id="ep_3">http://localhost:8280/services/ep_3</mapping>
<mappings>
Run Code Online (Sandbox Code Playgroud)
我想从注册表项加载数据.我认为以下内容可行:
但是,它会引发异常:
Evaluation of the XPath expression conf:/custom/inspectieview/routing.xml') resulted in an error {org.apache.synapse.util.xpath.SynapseXPath}
org.jaxen.UnresolvableException: Cannot resolve namespace prefix 'conf'
Run Code Online (Sandbox Code Playgroud)
任何人都知道是否可以将注册表中的值加载到属性介体中?
此致,nidkil