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
8e8155db
Commit
8e8155db
authored
Oct 25, 2017
by
Savorboard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Optimize message queue error message prompt.
parent
484a3c1e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
1 deletion
+13
-1
IConsumerHandler.Default.cs
src/DotNetCore.CAP/IConsumerHandler.Default.cs
+1
-1
LoggerExtensions.cs
src/DotNetCore.CAP/LoggerExtensions.cs
+12
-0
No files found.
src/DotNetCore.CAP/IConsumerHandler.Default.cs
View file @
8e8155db
...
@@ -105,7 +105,7 @@ namespace DotNetCore.CAP
...
@@ -105,7 +105,7 @@ namespace DotNetCore.CAP
Pulse
();
Pulse
();
};
};
client
.
OnError
+=
(
sender
,
reason
)
=>
{
_logger
.
Log
Error
(
reason
);
};
client
.
OnError
+=
(
sender
,
reason
)
=>
{
_logger
.
MessageQueue
Error
(
reason
);
};
}
}
private
static
void
StoreMessage
(
IServiceScope
serviceScope
,
MessageContext
messageContext
)
private
static
void
StoreMessage
(
IServiceScope
serviceScope
,
MessageContext
messageContext
)
...
...
src/DotNetCore.CAP/LoggerExtensions.cs
View file @
8e8155db
...
@@ -22,6 +22,8 @@ namespace DotNetCore.CAP
...
@@ -22,6 +22,8 @@ namespace DotNetCore.CAP
private
static
readonly
Action
<
ILogger
,
int
,
Exception
>
_jobRetrying
;
private
static
readonly
Action
<
ILogger
,
int
,
Exception
>
_jobRetrying
;
private
static
readonly
Action
<
ILogger
,
string
,
Exception
>
_exceptionOccuredWhileExecutingJob
;
private
static
readonly
Action
<
ILogger
,
string
,
Exception
>
_exceptionOccuredWhileExecutingJob
;
private
static
readonly
Action
<
ILogger
,
string
,
Exception
>
_messageQueueError
;
static
LoggerExtensions
()
static
LoggerExtensions
()
{
{
_serverStarting
=
LoggerMessage
.
Define
<
int
,
int
>(
_serverStarting
=
LoggerMessage
.
Define
<
int
,
int
>(
...
@@ -95,6 +97,11 @@ namespace DotNetCore.CAP
...
@@ -95,6 +97,11 @@ namespace DotNetCore.CAP
6
,
6
,
"An exception occured while trying to execute a message: '{MessageId}'. "
+
"An exception occured while trying to execute a message: '{MessageId}'. "
+
"Requeuing for another retry."
);
"Requeuing for another retry."
);
_messageQueueError
=
LoggerMessage
.
Define
<
string
>(
LogLevel
.
Error
,
7
,
"The MessageQueue Client fires an internal error:'{error}'."
);
}
}
public
static
void
JobFailed
(
this
ILogger
logger
,
Exception
ex
)
public
static
void
JobFailed
(
this
ILogger
logger
,
Exception
ex
)
...
@@ -167,5 +174,10 @@ namespace DotNetCore.CAP
...
@@ -167,5 +174,10 @@ namespace DotNetCore.CAP
{
{
_modelBinderFormattingException
(
logger
,
methodName
,
parameterName
,
content
,
ex
);
_modelBinderFormattingException
(
logger
,
methodName
,
parameterName
,
content
,
ex
);
}
}
public
static
void
MessageQueueError
(
this
ILogger
logger
,
string
error
)
{
_messageQueueError
(
logger
,
error
,
null
);
}
}
}
}
}
\ No newline at end of file
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