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
f184550a
Commit
f184550a
authored
Jun 27, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix RabbitMQ polling bug.
parent
0c1dffdd
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
3 deletions
+7
-3
IProcessor.RabbitJobProcessor.cs
src/DotNetCore.CAP.RabbitMQ/IProcessor.RabbitJobProcessor.cs
+2
-3
RabbitMQConsumerClient.cs
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
+5
-0
No files found.
src/DotNetCore.CAP.RabbitMQ/IProcessor.RabbitJobProcessor.cs
View file @
f184550a
...
...
@@ -136,11 +136,10 @@ namespace DotNetCore.CAP.RabbitMQ
using
(
var
connection
=
factory
.
CreateConnection
())
using
(
var
channel
=
connection
.
CreateModel
())
{
channel
.
ExchangeDeclare
(
exchange
:
"t
opic_logs
"
,
channel
.
ExchangeDeclare
(
exchange
:
"t
est
"
,
type
:
"topic"
);
var
body
=
Encoding
.
UTF8
.
GetBytes
(
content
);
channel
.
BasicPublish
(
exchange
:
"t
opic_logs
"
,
channel
.
BasicPublish
(
exchange
:
"t
est
"
,
routingKey
:
topic
,
basicProperties
:
null
,
body
:
body
);
...
...
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
View file @
f184550a
using
System
;
using
System.Text
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Infrastructure
;
using
RabbitMQ.Client
;
using
RabbitMQ.Client.Events
;
...
...
@@ -53,6 +54,10 @@ namespace DotNetCore.CAP.RabbitMQ
var
consumer
=
new
EventingBasicConsumer
(
_channel
);
consumer
.
Received
+=
OnConsumerReceived
;
_channel
.
BasicConsume
(
_queueName
,
true
,
consumer
);
while
(
true
)
{
Task
.
Delay
(
timeout
);
}
}
public
void
Subscribe
(
string
topic
)
...
...
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