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
2eaca664
Commit
2eaca664
authored
Jul 31, 2017
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
supports one method subscribing multiple messages.
parent
a1bec855
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
14 deletions
+17
-14
IConsumerServiceSelector.Default.cs
...tNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs
+17
-14
No files found.
src/DotNetCore.CAP/Internal/IConsumerServiceSelector.Default.cs
View file @
2eaca664
...
...
@@ -58,13 +58,7 @@ namespace DotNetCore.CAP.Internal
continue
;
}
foreach
(
var
method
in
typeInfo
.
DeclaredMethods
)
{
var
topicAttr
=
method
.
GetCustomAttribute
<
TopicAttribute
>(
true
);
if
(
topicAttr
==
null
)
continue
;
executorDescriptorList
.
Add
(
InitDescriptor
(
topicAttr
,
method
,
typeInfo
));
}
executorDescriptorList
.
AddRange
(
GetTopicAttributesDescription
(
typeInfo
));
}
return
executorDescriptorList
;
}
...
...
@@ -82,18 +76,27 @@ namespace DotNetCore.CAP.Internal
//double check
if
(!
Helper
.
IsController
(
typeInfo
))
continue
;
foreach
(
var
method
in
typeInfo
.
DeclaredMethods
)
{
var
topicAttr
=
method
.
GetCustomAttribute
<
TopicAttribute
>(
true
);
if
(
topicAttr
==
null
)
continue
;
executorDescriptorList
.
Add
(
InitDescriptor
(
topicAttr
,
method
,
typeInfo
));
}
executorDescriptorList
.
AddRange
(
GetTopicAttributesDescription
(
typeInfo
));
}
return
executorDescriptorList
;
}
private
static
IEnumerable
<
ConsumerExecutorDescriptor
>
GetTopicAttributesDescription
(
TypeInfo
typeInfo
)
{
foreach
(
var
method
in
typeInfo
.
DeclaredMethods
)
{
var
topicAttrs
=
method
.
GetCustomAttributes
<
TopicAttribute
>(
true
);
if
(
topicAttrs
.
Count
()
==
0
)
continue
;
foreach
(
var
attr
in
topicAttrs
)
{
yield
return
InitDescriptor
(
attr
,
method
,
typeInfo
);
}
}
}
private
static
ConsumerExecutorDescriptor
InitDescriptor
(
TopicAttribute
attr
,
MethodInfo
methodInfo
,
...
...
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