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
a060be4f
Commit
a060be4f
authored
May 22, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
c364e476
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
2 deletions
+54
-2
ConsistencyMessage.cs
src/Cap.Consistency/Infrastructure/ConsistencyMessage.cs
+51
-0
DeliverMessage.cs
src/Cap.Consistency/Infrastructure/DeliverMessage.cs
+2
-1
IConsumerExcutorSelector.cs
...ap.Consistency/Infrastructure/IConsumerExcutorSelector.cs
+1
-1
No files found.
src/Cap.Consistency/Infrastructure/ConsistencyMessage.cs
0 → 100644
View file @
a060be4f
using
System
;
namespace
Cap.Consistency.Infrastructure
{
/// <summary>
/// The default implementation of <see cref="ConsistencyMessage{TKey}"/> which uses a string as a primary key.
/// </summary>
public
class
ConsistencyMessage
:
ConsistencyMessage
<
string
>
{
/// <summary>
/// Initializes a new instance of <see cref="ConsistencyMessage"/>.
/// </summary>
/// <remarks>
/// The Id property is initialized to from a new GUID string value.
/// </remarks>
public
ConsistencyMessage
()
{
Id
=
Guid
.
NewGuid
().
ToString
();
SendTime
=
DateTime
.
Now
;
UpdateTime
=
SendTime
;
Status
=
MessageStatus
.
WaitForSend
;
}
}
/// <summary>
/// ConsistencyMessage consume status
/// </summary>
public
enum
MessageStatus
{
Deleted
=
0
,
WaitForSend
=
1
,
RollbackSuccessed
=
3
,
RollbackFailed
=
4
}
/// <summary>
/// Represents a message in the consistency system
/// </summary>
/// <typeparam name="TKey">The type used for the primary key for the message.</typeparam>
public
class
ConsistencyMessage
<
TKey
>
where
TKey
:
IEquatable
<
TKey
>
{
public
virtual
TKey
Id
{
get
;
set
;
}
public
virtual
DateTime
SendTime
{
get
;
set
;
}
public
string
Payload
{
get
;
set
;
}
public
MessageStatus
Status
{
get
;
set
;
}
public
virtual
DateTime
?
UpdateTime
{
get
;
set
;
}
}
}
\ No newline at end of file
src/Cap.Consistency/Infrastructure/DeliverMessage.cs
View file @
a060be4f
...
@@ -16,6 +16,8 @@ namespace Cap.Consistency.Infrastructure
...
@@ -16,6 +16,8 @@ namespace Cap.Consistency.Infrastructure
public
byte
[]
Body
{
get
;
set
;
}
public
byte
[]
Body
{
get
;
set
;
}
public
string
Value
{
get
;
set
;
}
}
}
...
@@ -27,6 +29,5 @@ namespace Cap.Consistency.Infrastructure
...
@@ -27,6 +29,5 @@ namespace Cap.Consistency.Infrastructure
public
long
Offset
{
get
;
set
;
}
public
long
Offset
{
get
;
set
;
}
public
string
MessageId
{
get
;
set
;
}
public
string
MessageId
{
get
;
set
;
}
}
}
}
}
src/Cap.Consistency/Infrastructure/IConsumerExcutorSelector.cs
View file @
a060be4f
...
@@ -10,6 +10,6 @@ namespace Cap.Consistency.Infrastructure
...
@@ -10,6 +10,6 @@ namespace Cap.Consistency.Infrastructure
{
{
IReadOnlyList
<
ConsumerExecutorDescriptor
>
SelectCandidates
(
TopicRouteContext
context
);
IReadOnlyList
<
ConsumerExecutorDescriptor
>
SelectCandidates
(
TopicRouteContext
context
);
ConsumerExecutorDescriptor
SelectBestCandidate
(
TopicRouteContext
context
,
IReadOnlyList
<
ConsumerExecutorDescriptor
>
executeDescriptor
);
ConsumerExecutorDescriptor
SelectBestCandidate
(
string
key
,
IReadOnlyList
<
ConsumerExecutorDescriptor
>
executeDescriptor
);
}
}
}
}
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