You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configuration.md 5.6 KiB

5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
5 vuotta sitten
add docs to master (#284) * update version to 2.4.0 * Add version options to config file. * update resource * add message version support for dashboard * add message version support for dashboard * Support using version to isolate messages. #220 * update mongo unit tests * update unit tests * update unit tests * Set default versions for consumer groups * solve the problem of issue#181 (#237) * Issue#235 (#238) * solve the problem of issue#181 * solve the problem of issue#235 * refactor * Fix the message persistence bug. #240 * using new CamelCaseNamingStrategy * update packages to .net core 2.2 * update test framework to netcoreapp2.2 * Update .travis.yml * update TargetFramework * Exclude build samples project * update version to 2.4.1 * add samples project to sln for build * update version to 2.4.2 * Fixed PostgreSql version isolation feature bug. (#256) * Fixed spelling errors * modify cap publish Message to rabbitmq slow (#261) * Startup the CAP with the BackgroundService. #265 * update samples * Fixed SQL query bug. #266 * update travis ci config * update travis ci config * adjust dashboard table column width * adjust the consumer execution time to milliseconds * update ignore * add mkdocs.yml * update version to 2.4.3 * add about.md docs * add index.md docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * add docs * Fix resource files * add docs * add docs * add docs * Create readme.md * add markdown extensions supports * update about.md * add CNAME fiel * add img * update docs * Update README.zh-cn.md
5 vuotta sitten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. # Configuration
  2. CAP uses Microsoft.Extensions.DependencyInjection for configuration injection.
  3. ## CAP Configs
  4. You can use the following methods to configure some configuration items in the CAP, for example:
  5. ```cs
  6. services.AddCap(capOptions => {
  7. capOptions.FailedCallback = //...
  8. });
  9. ```
  10. `CapOptions` provides the following configuration items::
  11. NAME | DESCRIPTION | TYPE | DEFAULT
  12. :---|:---|---|:------
  13. DefaultGroup | Default consumer group to which the subscriber belongs | string | cap.queue+{assembly name}
  14. SuccessedMessageExpiredAfter | Expiration date after successful message was deleted | int | 3600 seconds
  15. FailedCallback|Callback function when the failed message is executed. See below for details | Action | NULL
  16. FailedRetryInterval | Failed Retry Interval | int | 60 seconds
  17. FailedRetryCount | Failed RetryCount | int | 50th
  18. CapOptions provides a callback function for `FailedCallback` to handle failed messages. When the message fails to be sent multiple times, the CAP will mark the message state as `Failed`. The CAP has a special handler to handle this failed message. The failed message will be put back into the queue and sent to MQ. Prior to this, if `FailedCallback` has a value, this callback function will be called first to tell the client.
  19. The type of FailedCallback is `Action<MessageType,string,string>`. The first parameter is the message type (send or receive), the second parameter is the name of the message, and the third parameter is the content of the message.
  20. ## RabbitMQ Configs
  21. The CAP uses the CapOptions extension to implement the RabbitMQ configuration function. Therefore, the configuration of the RabbitMQ is used as follows:
  22. ```cs
  23. services.AddCap(capOptions => {
  24. capOptions.UseRabbitMQ(rabbitMQOption=>{
  25. // rabbitmq options.
  26. });
  27. });
  28. ```
  29. `RabbitMQOptions` provides related RabbitMQ configuration:
  30. NAME | DESCRIPTION | TYPE | DEFAULT
  31. :---|:---|---|:------
  32. HostName | Host Address | string | localhost
  33. UserName | username | string | guest
  34. Password | Password | string | guest
  35. VirtualHost | Virtual Host | string | /
  36. Port | Port number | int | -1
  37. TopicExchangeName | CAP Default Exchange Name | string | cap.default.topic
  38. RequestedConnectionTimeout | RabbitMQ Connection Timeout | int | 30,000 milliseconds
  39. SocketReadTimeout | RabbitMQ message read timeout | int | 30,000 milliseconds
  40. SocketWriteTimeout | RabbitMQ message write timeout | int | 30,000 milliseconds
  41. QueueMessageExpires | Automatic deletion of messages in queue | int | (10 days) ms
  42. ### Kafka Configs
  43. CAP adopts Kafka's configuration function to expand CapOptions, so the configuration usage for Kafka is as follows:
  44. ```cs
  45. services.AddCap(capOptions => {
  46. capOptions.UseKafka(kafkaOption=>{
  47. // kafka options.
  48. // kafkaOptions.MainConfig.Add("", "");
  49. });
  50. });
  51. ```
  52. `KafkaOptions` provides Kafka-related configurations. Because Kafka has more configurations, the MainConfig dictionary provided here is used to support custom configurations. You can check here to get support information for configuration items.
  53. [https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md](https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md)
  54. ### EntityFramework Configs
  55. If you are using Entityframework as a message persistence store, then you can customize some configuration when configuring the CAP EntityFramework configuration item.
  56. ```cs
  57. services.AddCap(x =>
  58. {
  59. x.UseEntityFramework<AppDbContext>(efOption =>
  60. {
  61. // entityframework options.
  62. });
  63. });
  64. ```
  65. Note that if you use the `UseEntityFramework` configuration item, then you do not need to reconfigure the following sections for several different database configurations. The CAP will automatically read the database configuration information used in DbContext.
  66. NAME | DESCRIPTION | TYPE | DEFAULT
  67. :---|:---|---|:------
  68. Schema | Cap table schema | string | Cap (SQL Server)
  69. Schema | Cap table schema | string | cap (PostgreSql)
  70. TableNamePrefix | Cap table name prefix | string | cap (MySql)
  71. ### SqlServer Configs
  72. Note that if you are using EntityFramewrok, you do not use this configuration item.
  73. CAP adopts the configuration function of SqlServer for extending CapOptions. Therefore, the configuration usage of SqlServer is as follows:
  74. ```cs
  75. services.AddCap(capOptions => {
  76. capOptions.UseSqlServer(sqlserverOptions => {
  77. // sqlserverOptions.ConnectionString
  78. });
  79. });
  80. ```
  81. NAME | DESCRIPTION | TYPE | DEFAULT
  82. :---|:---|---|:------
  83. Schema | Cap Table Schema | string | Cap
  84. ConnectionString | Database connection string | string | null
  85. ### MySql Configs
  86. Note that if you are using EntityFramewrok, you do not use this configuration item.
  87. CAP uses the configuration function for MySql that extends for CapOptions, so the configuration usage for MySql is as follows:
  88. ```cs
  89. services.AddCap(capOptions => {
  90. capOptions.UseMySql(mysqlOptions => {
  91. // mysqlOptions.ConnectionString
  92. });
  93. });
  94. ```
  95. NAME | DESCRIPTION | TYPE | DEFAULT
  96. :---|:---|---|:------
  97. TableNamePrefix | Cap table name prefix | string | cap
  98. ConnectionString | Database connection string | string | null
  99. ### PostgreSql Configs
  100. Note that if you are using EntityFramewrok, you do not use this configuration item.
  101. CAP uses PostgreSql configuration functions for CapOptions extensions, so the configuration usage for PostgreSql is as follows:
  102. ```c#
  103. services.AddCap(capOptions => {
  104. capOptions.UsePostgreSql(postgreOptions => {
  105. // postgreOptions.ConnectionString
  106. });
  107. });
  108. ```
  109. NAME | DESCRIPTION | TYPE | DEFAULT
  110. :---|:---|---|:------
  111. Schema | Cap table name prefix | string | cap
  112. ConnectionString | Database connection string | string | null