Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
N
Notification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OSDU
OSDU Data Platform
System
Notification
Commits
284b2428
Commit
284b2428
authored
3 years ago
by
Sathyanarayanan Saravanamuthu
Browse files
Options
Downloads
Patches
Plain Diff
Adding entries to requests table on notification processing
parent
fac8925e
No related branches found
No related tags found
3 merge requests
!232
Update os-core-lib-azure
,
!231
initial commit
,
!181
Adding entries to requests table on notification processing
Pipeline
#91520
failed
3 years ago
Stage: .pre
Stage: review
Stage: coverage
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/ProcessNotification.java
+21
-0
21 additions, 0 deletions
...cation/provider/azure/messageBus/ProcessNotification.java
with
21 additions
and
0 deletions
provider/notification-azure/src/main/java/org/opengroup/osdu/notification/provider/azure/messageBus/ProcessNotification.java
+
21
−
0
View file @
284b2428
...
...
@@ -14,7 +14,10 @@
package
org.opengroup.osdu.notification.provider.azure.messageBus
;
import
com.microsoft.applicationinsights.TelemetryClient
;
import
com.microsoft.applicationinsights.telemetry.RequestTelemetry
;
import
com.microsoft.azure.servicebus.IMessage
;
import
org.apache.commons.lang3.time.StopWatch
;
import
org.opengroup.osdu.core.common.http.HttpResponse
;
import
org.opengroup.osdu.core.common.model.http.DpsHeaders
;
import
org.opengroup.osdu.notification.provider.azure.messageBus.thread.ThreadScopeContextHolder
;
...
...
@@ -45,6 +48,10 @@ public class ProcessNotification {
private
MDCContextMap
mdcContextMap
;
public
void
performNotification
(
IMessage
message
,
String
subscriptionName
)
throws
Exception
{
TelemetryClient
telemetryClient
=
new
TelemetryClient
();
StopWatch
stopWatch
=
new
StopWatch
();
stopWatch
.
start
();
try
{
NotificationContent
notificationContent
=
requestBodyAdapter
.
extractNotificationContent
(
message
,
subscriptionName
);
...
...
@@ -58,8 +65,22 @@ public class ProcessNotification {
HttpResponse
response
=
notificationHandler
.
notifySubscriber
(
notificationContent
.
getNotificationId
(),
notificationContent
.
getData
(),
notificationContent
.
getExtractAttributes
());
RequestTelemetry
requestTelemetry
=
new
RequestTelemetry
(
"SBQueueRequest"
,
new
Date
(),
stopWatch
.
getTime
(),
"500"
,
false
);
requestTelemetry
.
setId
(
message
.
getMessageId
());
if
(!
response
.
isSuccessCode
())
{
telemetryClient
.
trackRequest
(
requestTelemetry
);
throw
new
Exception
(
NOT_ACKNOWLEDGE
);
}
else
{
requestTelemetry
.
setResponseCode
(
"200"
);
requestTelemetry
.
setSuccess
(
true
);
telemetryClient
.
trackRequest
(
requestTelemetry
);
}
}
catch
(
Exception
e
)
{
LOGGER
.
error
(
String
.
format
(
"An error occurred performing Notification for message with ID: "
,
message
.
getMessageId
()),
e
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment