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
c1b1509e
Commit
c1b1509e
authored
May 15, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor
parent
7e84a153
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
4 deletions
+12
-4
ConsistencyBuilder.cs
src/Cap.Consistency/Builder/ConsistencyBuilder.cs
+12
-4
No files found.
src/Cap.Consistency/Builder/ConsistencyBuilder.cs
View file @
c1b1509e
...
@@ -5,7 +5,10 @@ using System.Linq;
...
@@ -5,7 +5,10 @@ using System.Linq;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
using
System.Collections.Generic
;
using
System.Collections.Generic
;
using
Cap.Consistency.Consumer
;
using
Cap.Consistency.Consumer
;
using
Cap.Consistency.Consumer.Kafka
;
using
Cap.Consistency.Routing
;
using
Cap.Consistency.Infrastructure
;
using
Cap.Consistency.Internal
;
using
Cap.Consistency.Abstractions
;
namespace
Cap.Consistency
namespace
Cap.Consistency
{
{
...
@@ -24,6 +27,8 @@ namespace Cap.Consistency
...
@@ -24,6 +27,8 @@ namespace Cap.Consistency
Services
=
service
;
Services
=
service
;
AddConsumerServices
();
AddConsumerServices
();
AddKafkaServices
();
}
}
/// <summary>
/// <summary>
...
@@ -60,14 +65,17 @@ namespace Cap.Consistency
...
@@ -60,14 +65,17 @@ namespace Cap.Consistency
Services
.
AddSingleton
(
typeof
(
IConsumerService
),
type
);
Services
.
AddSingleton
(
typeof
(
IConsumerService
),
type
);
}
}
}
}
Services
.
AddSingleton
<
IConsumerExcutorSelector
,
ConsumerExcutorSelector
>();
Services
.
AddSingleton
<
IConsumerInvokerFactory
,
ConsumerInvokerFactory
>();
Services
.
AddSingleton
<
MethodMatcherCache
>();
return
this
;
return
this
;
}
}
public
virtual
ConsistencyBuilder
AddKafkaServices
()
{
public
virtual
ConsistencyBuilder
AddKafkaServices
()
{
return
AddScoped
(
typeof
(
ITopicRoute
),
typeof
(
ConsumerHandler
<>).
MakeGenericType
(
MessageType
));
Services
.
AddSingleton
<
IConsumerHandler
,
KafkaConsumerHandler
>();
return
this
;
}
}
...
...
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