Skip to content

Commit 958387c

Browse files
mongodb
1 parent c82e282 commit 958387c

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

spring-boot-mongodb/README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,24 @@
1313
- Wechat:关注公众号,搜云库,专注于开发技术的研究与知识分享
1414

1515
![关注公众号-搜云库](http://www.ymq.io/images/souyunku.png "搜云库")
16+
17+
18+
db.createUser(
19+
{
20+
user: "admin",
21+
pwd: "zgzz2025",
22+
roles: [ { role: "userAdminAnyDatabase", db: "admin" } ]
23+
}
24+
)
25+
26+
db.grantRolesToUser("admin", [{role: "dbOwner", db: "test" }]);
27+
28+
db.createCollection('var_setting')
29+
db.createCollection('var_value')
30+
31+
netstat -tunlp|grep mongo
32+
mongod --config /var/lib/mongodb/conf/rs2.conf &
33+
34+
netstat -tunlp|grep mongo
35+
mongod --config /var/lib/mongodb/conf/rs2.conf &
36+
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
spring.application.name=spring-boot-mongodb
22
# mongodb
3-
spring.data.mongodb.uri=mongodb://192.168.252.121:20000,192.168.252.122:20000,192.168.252.12:20000/demo
3+
#spring.data.mongodb.uri=mongodb://192.168.252.121:20000,192.168.252.122:20000,192.168.252.12:20000/demo
4+
5+
spring.data.mongodb.uri=mongodb://39.106.165.204:8700
6+
spring.data.mongodb.username=admin
7+
spring.data.mongodb.password=zgzz2025

spring-boot-rabbitmq/src/main/java/io/ymq/rabbitmq/config/Sender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public String topicSendMessage(final String name) {
2323

2424
String context = "hello "+name+" --" + new Date().getTime();
2525
System.out.println(context);
26-
this.rabbitTemplate.convertAndSend("topicExchange", "topic.message.123", context);
26+
this.rabbitTemplate.convertAndSend("topicExchange", "topic.message", context);
2727
return context;
2828
}
2929
}

0 commit comments

Comments
 (0)