微服务架构实践:PostgreSQL、MongoDB 与 GraphQL 应用
1. PostgreSQL 微服务搭建与测试
1.1 配置文件
application.properties 文件用于配置 Product Server 微服务的各项参数,包括应用名称、端口、数据源 URL、用户名、密码等,同时指定 Liquibase 变更日志文件和 JPA 相关属性。以下是配置文件示例:
spring.application.name = product-server
server.port=8081
spring.datasource.url=jdbc:postgresql://${DB_SERVER}/${POSTGRES_DB}
spring.datasource.username=${POSTGRES_USER}
spring.datasource.password=${POSTGRES_PASSWORD}
spring.liquibase.change-log=classpath:/db/changelog/db.changelog-master.xml
spring.jpa.properties.hibernate.jdbc.lob.non_contextual_creation=true
spring.jpa.show-sql=true
1.2 启动 PostgreSQL 服务器
使用以下命令启动 PostgreSQL 服务器:
超级会员免费看
订阅专栏 解锁全文
1290

被折叠的 条评论
为什么被折叠?



