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
926769d3
Commit
926769d3
authored
Jul 28, 2017
by
yangxiaodong
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cleanup code.
parent
153dc812
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
19 additions
and
32 deletions
+19
-32
CAP.KafkaCapOptionsExtension.cs
src/DotNetCore.CAP.Kafka/CAP.KafkaCapOptionsExtension.cs
+1
-1
PublishQueueExecutor.cs
src/DotNetCore.CAP.Kafka/PublishQueueExecutor.cs
+0
-1
CAP.MySqlCapOptionsExtension.cs
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
+1
-1
IAdditionalProcessor.Default.cs
src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs
+0
-1
MySqlStorage.cs
src/DotNetCore.CAP.MySql/MySqlStorage.cs
+0
-1
MySqlStorageConnection.cs
src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs
+2
-2
RabbitMQConsumerClient.cs
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
+1
-0
CapPublisher.cs
src/DotNetCore.CAP.SqlServer/CapPublisher.cs
+1
-1
SqlServerStorageConnection.cs
src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs
+1
-1
ConsumerContext.cs
src/DotNetCore.CAP/Abstractions/ConsumerContext.cs
+0
-1
ModelBindingResult.cs
...tCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs
+1
-1
CAP.ServiceCollectionExtensions.cs
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs
+1
-2
IStorageConnection.cs
src/DotNetCore.CAP/IStorageConnection.cs
+1
-0
WebHookProvider.cs
src/DotNetCore.CAP/Infrastructure/WebHookProvider.cs
+1
-3
ConsumerInvokerFactory.cs
src/DotNetCore.CAP/Internal/ConsumerInvokerFactory.cs
+0
-2
HashCodeCombiner.cs
src/DotNetCore.CAP/Internal/HashCodeCombiner.cs
+1
-1
IConsumerInvoker.Default.cs
src/DotNetCore.CAP/Internal/IConsumerInvoker.Default.cs
+1
-1
IModelBinder.ComplexType.cs
src/DotNetCore.CAP/Internal/IModelBinder.ComplexType.cs
+0
-1
IModelBinder.SimpleType.cs
src/DotNetCore.CAP/Internal/IModelBinder.SimpleType.cs
+1
-1
IModelBinderFactory.cs
src/DotNetCore.CAP/Internal/IModelBinderFactory.cs
+1
-1
CapPublishedMessage.cs
src/DotNetCore.CAP/Models/CapPublishedMessage.cs
+0
-1
CapReceivedMessage.cs
src/DotNetCore.CAP/Models/CapReceivedMessage.cs
+0
-1
IProcessingServer.Cap.cs
src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs
+1
-1
IProcessor.FailedJob.cs
src/DotNetCore.CAP/Processor/IProcessor.FailedJob.cs
+1
-4
QueueExecutorFactory.cs
src/DotNetCore.CAP/QueueExecutorFactory.cs
+2
-2
No files found.
src/DotNetCore.CAP.Kafka/CAP.KafkaCapOptionsExtension.cs
View file @
926769d3
...
@@ -21,7 +21,7 @@ namespace DotNetCore.CAP
...
@@ -21,7 +21,7 @@ namespace DotNetCore.CAP
var
kafkaOptions
=
new
KafkaOptions
();
var
kafkaOptions
=
new
KafkaOptions
();
_configure
(
kafkaOptions
);
_configure
(
kafkaOptions
);
services
.
AddSingleton
(
kafkaOptions
);
services
.
AddSingleton
(
kafkaOptions
);
services
.
AddSingleton
<
IConsumerClientFactory
,
KafkaConsumerClientFactory
>();
services
.
AddSingleton
<
IConsumerClientFactory
,
KafkaConsumerClientFactory
>();
services
.
AddTransient
<
IQueueExecutor
,
PublishQueueExecutor
>();
services
.
AddTransient
<
IQueueExecutor
,
PublishQueueExecutor
>();
}
}
...
...
src/DotNetCore.CAP.Kafka/PublishQueueExecutor.cs
View file @
926769d3
...
@@ -2,7 +2,6 @@
...
@@ -2,7 +2,6 @@
using
System.Text
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Confluent.Kafka
;
using
Confluent.Kafka
;
using
Confluent.Kafka.Serialization
;
using
DotNetCore.CAP.Processor.States
;
using
DotNetCore.CAP.Processor.States
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Options
;
using
Microsoft.Extensions.Options
;
...
...
src/DotNetCore.CAP.MySql/CAP.MySqlCapOptionsExtension.cs
View file @
926769d3
using
System
;
using
System
;
using
DotNetCore.CAP.Processor
;
using
DotNetCore.CAP.MySql
;
using
DotNetCore.CAP.MySql
;
using
DotNetCore.CAP.Processor
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.EntityFrameworkCore
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
...
...
src/DotNetCore.CAP.MySql/IAdditionalProcessor.Default.cs
View file @
926769d3
using
System
;
using
System
;
using
System.Data.SqlClient
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Dapper
;
using
DotNetCore.CAP.Processor
;
using
DotNetCore.CAP.Processor
;
...
...
src/DotNetCore.CAP.MySql/MySqlStorage.cs
View file @
926769d3
using
System.Data.SqlClient
;
using
System.Threading
;
using
System.Threading
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
Dapper
;
using
Dapper
;
...
...
src/DotNetCore.CAP.MySql/MySqlStorageConnection.cs
View file @
926769d3
...
@@ -46,7 +46,7 @@ namespace DotNetCore.CAP.MySql
...
@@ -46,7 +46,7 @@ namespace DotNetCore.CAP.MySql
//SELECT MessageId,MessageType FROM `{_prefix}.queue` LIMIT 1 FOR UPDATE;
//SELECT MessageId,MessageType FROM `{_prefix}.queue` LIMIT 1 FOR UPDATE;
//DELETE FROM `{_prefix}.queue` LIMIT 1;
//DELETE FROM `{_prefix}.queue` LIMIT 1;
//COMMIT;
//COMMIT;
var
sql
=
$@"
var
sql
=
$@"
SELECT `MessageId`,`MessageType` FROM `
{
_prefix
}
.queue` LIMIT 1 FOR UPDATE;
SELECT `MessageId`,`MessageType` FROM `
{
_prefix
}
.queue` LIMIT 1 FOR UPDATE;
DELETE FROM `
{
_prefix
}
.queue` LIMIT 1;"
;
DELETE FROM `
{
_prefix
}
.queue` LIMIT 1;"
;
...
@@ -123,7 +123,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
...
@@ -123,7 +123,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
private
async
Task
<
IFetchedMessage
>
FetchNextMessageCoreAsync
(
string
sql
,
object
args
=
null
)
private
async
Task
<
IFetchedMessage
>
FetchNextMessageCoreAsync
(
string
sql
,
object
args
=
null
)
{
{
//here don't use `using` to dispose
//here don't use `using` to dispose
var
connection
=
new
MySqlConnection
(
_options
.
ConnectionString
);
var
connection
=
new
MySqlConnection
(
_options
.
ConnectionString
);
await
connection
.
OpenAsync
();
await
connection
.
OpenAsync
();
var
transaction
=
connection
.
BeginTransaction
(
IsolationLevel
.
ReadCommitted
);
var
transaction
=
connection
.
BeginTransaction
(
IsolationLevel
.
ReadCommitted
);
...
...
src/DotNetCore.CAP.RabbitMQ/RabbitMQConsumerClient.cs
View file @
926769d3
...
@@ -19,6 +19,7 @@ namespace DotNetCore.CAP.RabbitMQ
...
@@ -19,6 +19,7 @@ namespace DotNetCore.CAP.RabbitMQ
private
ulong
_deliveryTag
;
private
ulong
_deliveryTag
;
public
event
EventHandler
<
MessageContext
>
OnMessageReceieved
;
public
event
EventHandler
<
MessageContext
>
OnMessageReceieved
;
public
event
EventHandler
<
string
>
OnError
;
public
event
EventHandler
<
string
>
OnError
;
public
RabbitMQConsumerClient
(
string
queueName
,
RabbitMQOptions
options
)
public
RabbitMQConsumerClient
(
string
queueName
,
RabbitMQOptions
options
)
...
...
src/DotNetCore.CAP.SqlServer/CapPublisher.cs
View file @
926769d3
...
@@ -55,7 +55,7 @@ namespace DotNetCore.CAP.SqlServer
...
@@ -55,7 +55,7 @@ namespace DotNetCore.CAP.SqlServer
return
PublishCoreAsync
(
name
,
content
);
return
PublishCoreAsync
(
name
,
content
);
}
}
public
void
Publish
<
T
>(
string
name
,
T
contentObj
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
public
void
Publish
<
T
>(
string
name
,
T
contentObj
,
IDbConnection
dbConnection
,
IDbTransaction
dbTransaction
=
null
)
{
{
CheckIsAdoNet
(
name
);
CheckIsAdoNet
(
name
);
...
...
src/DotNetCore.CAP.SqlServer/SqlServerStorageConnection.cs
View file @
926769d3
...
@@ -114,7 +114,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
...
@@ -114,7 +114,7 @@ VALUES(@Name,@Group,@Content,@Retries,@Added,@ExpiresAt,@StatusName);";
private
async
Task
<
IFetchedMessage
>
FetchNextMessageCoreAsync
(
string
sql
,
object
args
=
null
)
private
async
Task
<
IFetchedMessage
>
FetchNextMessageCoreAsync
(
string
sql
,
object
args
=
null
)
{
{
//here don't use `using` to dispose
//here don't use `using` to dispose
var
connection
=
new
SqlConnection
(
_options
.
ConnectionString
);
var
connection
=
new
SqlConnection
(
_options
.
ConnectionString
);
await
connection
.
OpenAsync
();
await
connection
.
OpenAsync
();
var
transaction
=
connection
.
BeginTransaction
(
IsolationLevel
.
ReadCommitted
);
var
transaction
=
connection
.
BeginTransaction
(
IsolationLevel
.
ReadCommitted
);
...
...
src/DotNetCore.CAP/Abstractions/ConsumerContext.cs
View file @
926769d3
using
System
;
using
System
;
using
DotNetCore.CAP.Infrastructure
;
namespace
DotNetCore.CAP.Abstractions
namespace
DotNetCore.CAP.Abstractions
{
{
...
...
src/DotNetCore.CAP/Abstractions/ModelBinding/ModelBindingResult.cs
View file @
926769d3
...
@@ -102,4 +102,4 @@ namespace DotNetCore.CAP.Abstractions.ModelBinding
...
@@ -102,4 +102,4 @@ namespace DotNetCore.CAP.Abstractions.ModelBinding
return
!
x
.
Equals
(
y
);
return
!
x
.
Equals
(
y
);
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/CAP.ServiceCollectionExtensions.cs
View file @
926769d3
...
@@ -3,7 +3,6 @@ using System.Collections.Generic;
...
@@ -3,7 +3,6 @@ using System.Collections.Generic;
using
System.Reflection
;
using
System.Reflection
;
using
DotNetCore.CAP
;
using
DotNetCore.CAP
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions.ModelBinding
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Infrastructure
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.Internal
;
using
DotNetCore.CAP.Processor
;
using
DotNetCore.CAP.Processor
;
...
@@ -60,7 +59,7 @@ namespace Microsoft.Extensions.DependencyInjection
...
@@ -60,7 +59,7 @@ namespace Microsoft.Extensions.DependencyInjection
foreach
(
var
serviceExtension
in
options
.
Extensions
)
foreach
(
var
serviceExtension
in
options
.
Extensions
)
{
{
serviceExtension
.
AddServices
(
services
);
serviceExtension
.
AddServices
(
services
);
}
}
services
.
AddSingleton
(
options
);
services
.
AddSingleton
(
options
);
return
new
CapBuilder
(
services
);
return
new
CapBuilder
(
services
);
...
...
src/DotNetCore.CAP/IStorageConnection.cs
View file @
926769d3
...
@@ -56,6 +56,7 @@ namespace DotNetCore.CAP
...
@@ -56,6 +56,7 @@ namespace DotNetCore.CAP
/// Returns executed failed message.
/// Returns executed failed message.
/// </summary>
/// </summary>
Task
<
IEnumerable
<
CapReceivedMessage
>>
GetFailedReceviedMessages
();
Task
<
IEnumerable
<
CapReceivedMessage
>>
GetFailedReceviedMessages
();
//-----------------------------------------
//-----------------------------------------
/// <summary>
/// <summary>
...
...
src/DotNetCore.CAP/Infrastructure/WebHookProvider.cs
View file @
926769d3
using
System
;
using
System
;
using
System.Collections.Generic
;
using
System.Text
;
namespace
DotNetCore.CAP.Infrastructure
namespace
DotNetCore.CAP.Infrastructure
{
{
...
@@ -11,4 +9,4 @@ namespace DotNetCore.CAP.Infrastructure
...
@@ -11,4 +9,4 @@ namespace DotNetCore.CAP.Infrastructure
throw
new
NotImplementedException
();
throw
new
NotImplementedException
();
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Internal/ConsumerInvokerFactory.cs
View file @
926769d3
using
System
;
using
System
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions
;
using
DotNetCore.CAP.Abstractions.ModelBinding
;
using
DotNetCore.CAP.Infrastructure
;
using
Microsoft.Extensions.Logging
;
using
Microsoft.Extensions.Logging
;
namespace
DotNetCore.CAP.Internal
namespace
DotNetCore.CAP.Internal
...
...
src/DotNetCore.CAP/Internal/HashCodeCombiner.cs
View file @
926769d3
...
@@ -78,4 +78,4 @@ namespace DotNetCore.CAP.Internal
...
@@ -78,4 +78,4 @@ namespace DotNetCore.CAP.Internal
return
new
HashCodeCombiner
(
0x1505L
);
return
new
HashCodeCombiner
(
0x1505L
);
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Internal/IConsumerInvoker.Default.cs
View file @
926769d3
...
@@ -57,7 +57,7 @@ namespace DotNetCore.CAP.Internal
...
@@ -57,7 +57,7 @@ namespace DotNetCore.CAP.Internal
catch
(
FormatException
ex
)
catch
(
FormatException
ex
)
{
{
_logger
.
ModelBinderFormattingException
(
_executor
.
MethodInfo
?.
Name
,
firstParameter
.
Name
,
value
,
ex
);
_logger
.
ModelBinderFormattingException
(
_executor
.
MethodInfo
?.
Name
,
firstParameter
.
Name
,
value
,
ex
);
}
}
}
}
else
else
{
{
...
...
src/DotNetCore.CAP/Internal/IModelBinder.ComplexType.cs
View file @
926769d3
...
@@ -26,7 +26,6 @@ namespace DotNetCore.CAP.Internal
...
@@ -26,7 +26,6 @@ namespace DotNetCore.CAP.Internal
catch
(
Exception
)
catch
(
Exception
)
{
{
return
Task
.
FromResult
(
ModelBindingResult
.
Failed
());
return
Task
.
FromResult
(
ModelBindingResult
.
Failed
());
}
}
}
}
}
}
...
...
src/DotNetCore.CAP/Internal/IModelBinder.SimpleType.cs
View file @
926769d3
...
@@ -83,4 +83,4 @@ namespace DotNetCore.CAP.Internal
...
@@ -83,4 +83,4 @@ namespace DotNetCore.CAP.Internal
return
!
type
.
GetTypeInfo
().
IsValueType
||
isNullableValueType
;
return
!
type
.
GetTypeInfo
().
IsValueType
||
isNullableValueType
;
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Internal/IModelBinderFactory.cs
View file @
926769d3
...
@@ -7,4 +7,4 @@ namespace DotNetCore.CAP.Internal
...
@@ -7,4 +7,4 @@ namespace DotNetCore.CAP.Internal
{
{
IModelBinder
CreateBinder
(
ParameterInfo
parameter
);
IModelBinder
CreateBinder
(
ParameterInfo
parameter
);
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/Models/CapPublishedMessage.cs
View file @
926769d3
using
System
;
using
System
;
using
DotNetCore.CAP.Infrastructure
;
namespace
DotNetCore.CAP.Models
namespace
DotNetCore.CAP.Models
{
{
...
...
src/DotNetCore.CAP/Models/CapReceivedMessage.cs
View file @
926769d3
using
System
;
using
System
;
using
DotNetCore.CAP.Infrastructure
;
namespace
DotNetCore.CAP.Models
namespace
DotNetCore.CAP.Models
{
{
...
...
src/DotNetCore.CAP/Processor/IProcessingServer.Cap.cs
View file @
926769d3
...
@@ -61,7 +61,7 @@ namespace DotNetCore.CAP.Processor
...
@@ -61,7 +61,7 @@ namespace DotNetCore.CAP.Processor
_logger
.
LogTrace
(
"Pulsing the Queuer."
);
_logger
.
LogTrace
(
"Pulsing the Queuer."
);
PublishQueuer
.
PulseEvent
.
Set
();
PublishQueuer
.
PulseEvent
.
Set
();
}
}
public
void
Dispose
()
public
void
Dispose
()
...
...
src/DotNetCore.CAP/Processor/IProcessor.FailedJob.cs
View file @
926769d3
using
System
;
using
System
;
using
System.Collections.Concurrent
;
using
System.Collections.Generic
;
using
System.Text
;
using
System.Threading.Tasks
;
using
System.Threading.Tasks
;
using
DotNetCore.CAP.Processor.States
;
using
DotNetCore.CAP.Processor.States
;
using
Microsoft.Extensions.DependencyInjection
;
using
Microsoft.Extensions.DependencyInjection
;
...
@@ -83,4 +80,4 @@ namespace DotNetCore.CAP.Processor
...
@@ -83,4 +80,4 @@ namespace DotNetCore.CAP.Processor
}
}
}
}
}
}
}
}
\ No newline at end of file
src/DotNetCore.CAP/QueueExecutorFactory.cs
View file @
926769d3
...
@@ -18,8 +18,8 @@ namespace DotNetCore.CAP
...
@@ -18,8 +18,8 @@ namespace DotNetCore.CAP
{
{
var
queueExectors
=
_serviceProvider
.
GetServices
<
IQueueExecutor
>();
var
queueExectors
=
_serviceProvider
.
GetServices
<
IQueueExecutor
>();
return
messageType
==
MessageType
.
Publish
return
messageType
==
MessageType
.
Publish
?
queueExectors
.
FirstOrDefault
(
x
=>
x
is
BasePublishQueueExecutor
)
?
queueExectors
.
FirstOrDefault
(
x
=>
x
is
BasePublishQueueExecutor
)
:
queueExectors
.
FirstOrDefault
(
x
=>
!(
x
is
BasePublishQueueExecutor
));
:
queueExectors
.
FirstOrDefault
(
x
=>
!(
x
is
BasePublishQueueExecutor
));
}
}
}
}
...
...
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