-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(bean): Add bean sample to generate configuration programatically
- Loading branch information
1 parent
c5bf491
commit 453175a
Showing
11 changed files
with
240 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version=2.1.0 | ||
version=2.1.1 | ||
springBootVersion=3.2.4 | ||
reactorRabbitVersion=1.5.5 | ||
cloudEventsVersion=3.0.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
samples/async/async-sender-client/src/main/java/sample/MyRabbitMQConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package sample; | ||
|
||
import org.reactivecommons.async.rabbit.config.RabbitProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.context.annotation.Primary; | ||
|
||
@Configuration | ||
public class MyRabbitMQConfig { | ||
|
||
@Bean | ||
@Primary | ||
public RabbitProperties customRabbitProperties(){ | ||
RabbitProperties properties = new RabbitProperties(); | ||
properties.setHost("localhost"); | ||
properties.setPort(5672); | ||
properties.setVirtualHost("/"); | ||
properties.setUsername("guest"); | ||
properties.setPassword("guest"); | ||
return properties; | ||
} | ||
} |
38 changes: 38 additions & 0 deletions
38
samples/async/eda-async-receiver-responder/src/main/java/sample/MyDomainConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package sample; | ||
|
||
import org.reactivecommons.async.rabbit.config.RabbitProperties; | ||
import org.reactivecommons.async.rabbit.config.props.AsyncProps; | ||
import org.reactivecommons.async.rabbit.config.props.AsyncPropsDomainProperties; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Primary; | ||
|
||
//@Configuration | ||
public class MyDomainConfig { | ||
|
||
@Bean | ||
@Primary | ||
public AsyncPropsDomainProperties customDomainProperties() { | ||
RabbitProperties propertiesApp = new RabbitProperties(); | ||
propertiesApp.setHost("localhost"); | ||
propertiesApp.setPort(5672); | ||
propertiesApp.setVirtualHost("/"); | ||
propertiesApp.setUsername("guest"); | ||
propertiesApp.setPassword("guest"); | ||
|
||
RabbitProperties propertiesAccounts = new RabbitProperties(); | ||
propertiesAccounts.setHost("localhost"); | ||
propertiesAccounts.setPort(5672); | ||
propertiesAccounts.setVirtualHost("/accounts"); | ||
propertiesAccounts.setUsername("guest"); | ||
propertiesAccounts.setPassword("guest"); | ||
|
||
return AsyncPropsDomainProperties.builder() | ||
.withDomain("app", AsyncProps.builder() | ||
.connectionProperties(propertiesApp) | ||
.build()) | ||
.withDomain("accounts", AsyncProps.builder() | ||
.connectionProperties(propertiesAccounts) | ||
.build()) | ||
.build(); | ||
} | ||
} |
70 changes: 70 additions & 0 deletions
70
samples/async/thunder-collection_reactive-commons-eda-domain-a.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
{ | ||
"client": "Thunder Client", | ||
"collectionName": "reactive-commons-eda-domain-a", | ||
"dateExported": "2024-04-03T13:34:13.855Z", | ||
"version": "1.1", | ||
"folders": [], | ||
"requests": [ | ||
{ | ||
"_id": "854a1a8b-792f-4e93-81c0-7303cac31c3b", | ||
"colId": "4a3f48fc-b39b-4ae2-b90f-4b8dad86096a", | ||
"containerId": "", | ||
"name": "AddMember", | ||
"url": "http://localhost:4002/api/teams/ingsw/members", | ||
"method": "POST", | ||
"sortNum": 20000, | ||
"created": "2024-04-03T12:55:28.297Z", | ||
"modified": "2024-04-03T13:29:04.872Z", | ||
"headers": [], | ||
"params": [], | ||
"body": { | ||
"type": "json", | ||
"raw": "{\n \"name\": \"Juan\",\n \"username\": \"juancgalvis2\"\n}", | ||
"form": [] | ||
}, | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "8790f03f-9047-409e-8c6a-0435d71eacd4", | ||
"colId": "4a3f48fc-b39b-4ae2-b90f-4b8dad86096a", | ||
"containerId": "", | ||
"name": "GetTeams", | ||
"url": "http://localhost:4002/api/teams", | ||
"method": "GET", | ||
"sortNum": 40000, | ||
"created": "2024-04-03T12:55:28.300Z", | ||
"modified": "2024-04-03T12:57:16.723Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "3aeaf5d0-5f30-4e2c-a1da-d8ae26424d68", | ||
"colId": "4a3f48fc-b39b-4ae2-b90f-4b8dad86096a", | ||
"containerId": "", | ||
"name": "GetTeamMembers", | ||
"url": "http://localhost:4002/api/teams/ingsw", | ||
"method": "GET", | ||
"sortNum": 50000, | ||
"created": "2024-04-03T12:55:28.301Z", | ||
"modified": "2024-04-03T13:18:25.708Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "535f2605-b22c-45c2-b188-24ad850d9c8b", | ||
"colId": "4a3f48fc-b39b-4ae2-b90f-4b8dad86096a", | ||
"containerId": "", | ||
"name": "RemoveTeamMember", | ||
"url": "http://localhost:4002/api/teams/ingsw/members/juancgalvis2", | ||
"method": "DELETE", | ||
"sortNum": 60000, | ||
"created": "2024-04-03T12:55:28.302Z", | ||
"modified": "2024-04-03T13:29:48.474Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
{ | ||
"client": "Thunder Client", | ||
"collectionName": "reactive-commons", | ||
"dateExported": "2024-04-03T13:33:34.743Z", | ||
"version": "1.1", | ||
"folders": [], | ||
"requests": [ | ||
{ | ||
"_id": "067ac0d0-1a9f-4327-a502-62c8e7bb5ffd", | ||
"colId": "551afab7-c4ab-4191-bc26-2443aab6bc23", | ||
"containerId": "", | ||
"name": "AddMember", | ||
"url": "http://localhost:4001/api/teams/ingsw/members", | ||
"method": "POST", | ||
"sortNum": 20000, | ||
"created": "2024-04-02T20:49:04.005Z", | ||
"modified": "2024-04-02T20:54:44.056Z", | ||
"headers": [], | ||
"params": [], | ||
"body": { | ||
"type": "json", | ||
"raw": "{\n \"name\": \"Juan\",\n \"username\": \"juancgalvis\"\n}", | ||
"form": [] | ||
}, | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "9f5f058d-4758-4ec2-85a1-7b6a118e0c5f", | ||
"colId": "551afab7-c4ab-4191-bc26-2443aab6bc23", | ||
"containerId": "", | ||
"name": "GetTeams", | ||
"url": "http://localhost:4001/api/teams", | ||
"method": "GET", | ||
"sortNum": 40000, | ||
"created": "2024-04-02T20:56:13.923Z", | ||
"modified": "2024-04-02T20:56:26.311Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "4c972d14-2c3c-4f55-bf36-f652b4ea877f", | ||
"colId": "551afab7-c4ab-4191-bc26-2443aab6bc23", | ||
"containerId": "", | ||
"name": "GetTeamMembers", | ||
"url": "http://localhost:4001/api/teams/ingsw", | ||
"method": "GET", | ||
"sortNum": 50000, | ||
"created": "2024-04-02T20:56:54.150Z", | ||
"modified": "2024-04-02T20:58:17.562Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "476ad00a-fc04-4911-9731-16532e54a385", | ||
"colId": "551afab7-c4ab-4191-bc26-2443aab6bc23", | ||
"containerId": "", | ||
"name": "RemoveTeamMember", | ||
"url": "http://localhost:4001/api/teams/ingsw/members/juancgalvis", | ||
"method": "DELETE", | ||
"sortNum": 60000, | ||
"created": "2024-04-02T20:57:35.952Z", | ||
"modified": "2024-04-02T20:57:48.657Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
}, | ||
{ | ||
"_id": "abb1d0a5-ba07-4be3-a5a6-ab260e5f1ab7", | ||
"colId": "551afab7-c4ab-4191-bc26-2443aab6bc23", | ||
"containerId": "", | ||
"name": "RemoveTeams", | ||
"url": "http://localhost:4001/api/teams", | ||
"method": "DELETE", | ||
"sortNum": 70000, | ||
"created": "2024-04-02T20:58:32.517Z", | ||
"modified": "2024-04-02T20:58:53.275Z", | ||
"headers": [], | ||
"params": [], | ||
"tests": [] | ||
} | ||
] | ||
} |