Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
CAP
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
tsai
CAP
Commits
311d5e92
Commit
311d5e92
authored
Jun 27, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move some options config to other proejct.
parent
cedd9d9f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
14 deletions
+17
-14
ConsistencyDbContext.cs
...otNetCore.CAP.EntityFrameworkCore/ConsistencyDbContext.cs
+10
-3
CAP.Options.cs
src/DotNetCore.CAP/CAP.Options.cs
+1
-6
IConsumerClientFactory.cs
src/DotNetCore.CAP/IConsumerClientFactory.cs
+1
-3
IConsumerHandler.Default.cs
src/DotNetCore.CAP/IConsumerHandler.Default.cs
+1
-1
CapMessage.cs
src/DotNetCore.CAP/Infrastructure/CapMessage.cs
+4
-1
No files found.
src/DotNetCore.CAP.EntityFrameworkCore/ConsistencyDbContext.cs
View file @
311d5e92
...
...
@@ -24,7 +24,9 @@ namespace DotNetCore.CAP.EntityFrameworkCore
/// <summary>
/// Gets or sets the <see cref="DbSet{ConsistencyMessage}"/> of Messages.
/// </summary>
public
DbSet
<
CapMessage
>
Messages
{
get
;
set
;
}
public
DbSet
<
CapSentMessage
>
CapSentMessages
{
get
;
set
;
}
public
DbSet
<
CapReceivedMessage
>
CapReceivedMessages
{
get
;
set
;
}
/// <summary>
/// Configures the schema for the identity framework.
...
...
@@ -34,10 +36,15 @@ namespace DotNetCore.CAP.EntityFrameworkCore
/// </param>
protected
override
void
OnModelCreating
(
ModelBuilder
modelBuilder
)
{
modelBuilder
.
Entity
<
CapMessage
>(
b
=>
modelBuilder
.
Entity
<
Cap
Sent
Message
>(
b
=>
{
b
.
HasKey
(
m
=>
m
.
Id
);
b
.
ToTable
(
"ConsistencyMessages"
);
b
.
Property
(
p
=>
p
.
StateName
).
HasMaxLength
(
50
);
});
modelBuilder
.
Entity
<
CapReceivedMessage
>(
b
=>
{
b
.
Property
(
p
=>
p
.
StateName
).
HasMaxLength
(
50
);
});
}
}
...
...
src/DotNetCore.CAP/CAP.Options.cs
View file @
311d5e92
...
...
@@ -7,12 +7,7 @@ namespace DotNetCore.CAP.Infrastructure
/// </summary>
public
class
CapOptions
{
/// <summary>
/// kafka or rabbitMQ brokers connection string.
/// </summary>
public
string
BrokerUrlList
{
get
;
set
;
}
=
"localhost:9092"
;
/// <summary>
/// <summary>
/// Corn expression for configuring retry cron job. Default is 1 min.
/// </summary>
public
string
CronExp
{
get
;
set
;
}
=
Cron
.
Minutely
();
...
...
src/DotNetCore.CAP/IConsumerClientFactory.cs
View file @
311d5e92
...
...
@@ -9,8 +9,6 @@
/// Create a new instance of <see cref="IConsumerClient"/>.
/// </summary>
/// <param name="groupId"></param>
/// <param name="clientHostAddress"></param>
/// <returns></returns>
IConsumerClient
Create
(
string
groupId
,
string
clientHostAddress
);
IConsumerClient
Create
(
string
groupId
);
}
}
\ No newline at end of file
src/DotNetCore.CAP/IConsumerHandler.Default.cs
View file @
311d5e92
...
...
@@ -66,7 +66,7 @@ namespace DotNetCore.CAP
{
Task
.
Factory
.
StartNew
(()
=>
{
using
(
var
client
=
_consumerClientFactory
.
Create
(
matchGroup
.
Key
,
_options
.
BrokerUrlList
))
using
(
var
client
=
_consumerClientFactory
.
Create
(
matchGroup
.
Key
))
{
client
.
MessageReceieved
+=
OnMessageReceieved
;
...
...
src/DotNetCore.CAP/Infrastructure/CapMessage.cs
View file @
311d5e92
...
...
@@ -3,7 +3,7 @@
namespace
DotNetCore.CAP.Infrastructure
{
/// <summary>
///
The default implementation of <see cref="ConsistencyMessage{TKey}"/> which uses a string as a primary key
.
///
cap messages store model
.
/// </summary>
public
abstract
class
CapMessage
:
MessageBase
{
...
...
@@ -36,6 +36,9 @@ namespace DotNetCore.CAP.Infrastructure
public
string
StateName
{
get
;
set
;
}
}
/// <summary>
/// The message state name.
/// </summary>
public
struct
StateName
{
public
const
string
Enqueued
=
nameof
(
Enqueued
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment